THIS IS FOR MYSQL ONLY! NOT YOUR FIREWALL! NOT YOUR IPTABLES! NOTHIN BUT MYSQL!

Find your my.cnf
Debian/Ubuntu -> /etc/mysql/my.cnf
Red Hat Linux/Fedora/Centos -> /etc/my.cnf

sudo vi /etc/mysql/my.cnf

Make sure bind-address set to your server IP address, (the ip address of that machine, it will probably say 127.0.0.1)

bind-address = 192.158.5.1
Also make sure line skip-networking is removed or commented out
# skip-external-networking

sudo /etc/init.d/mysql restart

Let us assume that you are always making connection from remote IP called 202.54.10.20 for database called webdb for user webadmin then you need to grant access to this IP address.
At mysql> prompt type following command for existing database:

Code:
update db set Host='202.54.10.20' where Db='webdb';
update user set Host='202.54.10.20' where user='webadmin';