Mysql remote access
Right have a problem connecting to my mysql server remotely.
I can do mysql -h localhost -u jeebers -p and that works I can't on the other hand from the local machine do this mysql -h x.x.x.x -u jeebers -p where the x.. is the IP address of the machine. I get an error ERROR 2003 (HY000): Can't connect to MySQL server on 'x.x.x.x' (110) Now its a Debain etch machine and i've edited my "my.cnf" file and commented out bind-address and skip-networking. I've also restarted mysql. Anyone any thoughs on why it won't let me connect with the dedicated IP but it will with localhost? |
Have you checked your firewall settings?
Also, what does netstat -l | grep sql show? |
# netstat -l | grep mysql
tcp 0 0 *:mysql *:* LISTEN unix 2 [ ACC ] STREAM LISTENING 1659061 /var/run/mysqld/mysqld.sock Yea there might be something in the firewall settings that isn't allowing this but i can't figure out what that would. Its a dedicated server in a hosting company's environment. Any other tests i can do to narrow it down/ |
try
telnet se.rv.er.IP 3306 from the remote machine |
Also
iptables -L |
Quote:
|
Quote:
# iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination that is all that said? |
Check the Mysql db to make sure the system in allowed access by IP. The permissions table on MySql is strict on who can access the program.
|
I solved the problem in the end.
I needed to add -P3306 to my mysql request from the remote machine and it worked. i was defaulting to somethign else for some reason. I still can't connect from localhost with the IP but i suppose that doesn't really matter. thanks for the suggestions. |
If it's a public IP that's not surprising
|
grant ... to 'user'@'localhost'
Maybe the username you use is granted access only on localhost. Most tutorials suggest something like "grant all privileges on db.* to 'user'@'localhost' ...", so maybe you should grant access to that user with something like " ... to 'user'@'x.x.x.x' ...". (x.x.x.x is obviously to be replaced by the IP number).
Don't know if it solves your problem, could be caused by something else as well. Maybe worth trying... Server issues |
All times are GMT -5. The time now is 02:02 AM. |