For security reasons, TCP access to mysql is disabled by default in most Linux distributions. To enable it, you have to edit the my.cnf file (check in
/etc/my.cnf) and remove the
skip-networking option. For good measure, you can add:
bind-address=192.168.X.Y <-- your eth0 address here
You should also be aware that MySQL user restriction is based on source host. Logging in as root from localhost is not the same as logging in as root from
myothercoolserver.mydomain.com. Be sure to use the GRANT options required to allow
user@source to access the proper tables.
It is not recommended to allow the root user access from outside localhost.
Some more information on GRANT statements here.
Some other ideas you may want to try based upon our long discussion in the comments of this original answer:
- Use tcpdump on the MySQL server to determine if the traffic is even arriving at the host. A command like
tcpdump tcp port 3306 should work. If you see no traffic when attempting to connect it's likely that iptables or a hardware firewall between your external connection and the server is blocking tcp/3306.
- You can try
service iptables stop (assuming you've saved your rules in a place where they are managed by the init scripts) and see if that allows the traffic. If it does, revisit the iptables rules in
/etc/sysconfig/iptables.conf (or similiar) or post them into another question and someone should be able to point out what's blocking the traffic.