Link to home
Start Free TrialLog in
Avatar of letharion
letharionFlag for Sweden

asked on

Enable remote mysql access

I have set my.cnf to bind to my ip.
I have commented out "skip-networking"
I can't connect, it's probably something quite basic, because:

Zelda # telnet 192.168.0.35 3306
Trying 192.168.0.35...
Connected to 192.168.0.35.
Escape character is '^]'.
EHost '192.168.0.35' is not allowed to connect to this MySQL serverConnection closed by foreign host.
Avatar of ChristoferDutz
ChristoferDutz
Flag of Germany image

You have to explicityl allow a user to connect from a certain ip or "%" for all machines.
ASKER CERTIFIED SOLUTION
Avatar of theGhost_k8
theGhost_k8
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of letharion

ASKER

mysql> select user, password, host from user where user ="letharion";
+-----------+-------------------------------------------+--------------+
| user      | password                                  | host         |
+-----------+-------------------------------------------+--------------+
| letharion | *1F741C2CC5E5B34C1809CEC44DF4AB62D3D72BB2 | localhost    |
| letharion | *1F741C2CC5E5B34C1809CEC44DF4AB62D3D72BB2 | 127.0.0.1    |
| letharion | *1F741C2CC5E5B34C1809CEC44DF4AB62D3D72BB2 | 192.168.0.35 |

I figured maybe I was rejected before this table was even read as I never gave a username.
Is anything wrong with this layout?
Ähem ... the user is connecting TO a DB on 192.168.0.35, so you'd propably have to use the client's IP instead or use "%" for any host.
>>Have you grant permission for user @ that host?
I could have sworn I had tried that, but I wanted to start from the beginning, so I just mentioned the telnet.
Could it have made a difference that I didn't use '' around the username?

That fixed it in any case. Thanks
>>Ähem ... the user is connecting TO a DB on 192.168.0.35, so you'd propably have to use the client's IP instead or use "%" for any host.

You're ofc correct. But I was trying locally first :)
The grant command fixed it locally, and I added the external ip and now that works too.
yes for sure
Could it have made a difference that I didn't use '' around the username? << yes for sure