How Do I Enable Remote Access To MySQL Database Server?

How Do I Enable Remote Access To MySQL Database Server?

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:
[crayon-66359ee4d5b95185914208/]
Once connected you need to edit the MySQL server configuration file my.cnf using a text editor such as vi.
[crayon-66359ee4d5ba0470682193/]
[crayon-66359ee4d5ba2421226961/]
Step # 3: Once file opened, locate line that read as follows
[crayon-66359ee4d5ba4646728105/]
[crayon-66359ee4d5ba7820731087/]
Where,

bind-address : IP address to bind to.
skip-networking : Don’t listen for TCP/IP connections at all. All interaction with mysqld must be made via Unix sockets. This option is highly recommended for systems where only local requests are allowed. Since you need to allow remote connection this line should be removed from my.cnf or put it in comment state.
Step# 4 Save and Close the file
[crayon-66359ee4d5ba9476899718/]
Step # 5 Grant access to remote IP address
[crayon-66359ee4d5bac743833793/]
 

Step # 6: Logout of MySQL

Type exit command to logout mysql:
mysql> exit

Step # 7: Open port 3306
[crayon-66359ee4d5bae284641587/]
 

Step # 8: Test it
[crayon-66359ee4d5bb3079689093/]