Enable and Allow Remote Access to MySQL Server
By default your MySQL Server has default configuration to allow only local connection. So if your application connects MySQL in localhost, then the basic configuration can be left untouched.
If you are planning to allow and enable remote access to MySQL server, then follow the steps below :
Find the MySQL configuration file which mostly is located at /etc/my.cnf. Using a shell editor like vim or nano, find the following line and comment it
bind-address = x.x.x.x (x.x.x.x points to the ip address you wanted to access from remotely, incase multiple servers, just comment it like below)
#bind-address = x.x.x.x
Also for people using old MySQL server, make sure you also comment the following line
Restart your MySQL server
service mysqld restart
and try to connect your application with database present in remote server.
Note: You also need to give GRANT access to the db user on that particular DB.
Originally published at Sankaranand blog.