I had a similar problem trying to connect to a database from Windows using ODBC to mysql on a Centos server. After creating a log in account and giving priviliges and grants on mysql, I did the following...
I made sure my.cnf was set correctly
In /etc/my.cnf under [mysqld] commented out
In /etc/my.cnf [mysqld] I also set
instead of bind-address=127.0.0.1
In the /etc/hosts.allow, I listed
I added an iptable rule:
/sbin/iptables -A INPUT -i eth0 -p tcp --destination-port 3306 -j ACCEPT
I saved it:
I restarted the firewall:
I then checked the /etc/sysconfig/iptables file and I saw the entry:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
AND IT STILL DID NOT WORK!!!!
I rebooted the network service and nothing! I even rebooted the server, and nothing!
I gave up for the night and the next morning decided to use GUI settings on Centos. I came across this page:
I added port 3306 with the "Security Level Configuration Tool"
I tested again AND IT FINALLY WORKED!!!
I am not sure why adding it on the shell with the iptable command did not work, but at least it works now.
I know this is an old post but I'd though I'd add this in case others run into similar problems.