By default remote access to MySQL database server is disabled for security reasons. However, some time you need to provide remote access to database server from home or a web server. If you want to remotely access to the database server from the web server or home, follow this quick lessons.
MySQL Remote Access
You need type the following commands which will allow remote connections.
Step # 1: Login Using SSH (if server is outside your data center)
First, login over ssh to remote MySQL database server:
Once connected you need to edit the MySQL server configuration file my.cnf using a text editor such as vi.
§ If you are using Debian Linux file is located at /etc/mysql/my.cnf location
§ If you are using Red Hat Linux/Fedora/Centos Linux file is located at /etc/my.cnf location
§ If you are using FreeBSD you need to create a file /var/db/mysql/my.cnf
Edit /etc/my.cnf, run:
Step # 3: Once file opened, locate line that read as follows
Make sure line skip-networking is commented (or remove line) and add following line