How to allow remote connection to MySQL

Date: March 4th, 2007
Author: Stefan Batanov

This tutorial will show you how to allow remote login to MySQL server for specific user. By default MSQL servers allow connections only from localhost.

You have to login to ssh (Secure Shell) and have root privileges.

You have to do the following in after you login ssh.


  1. %mysl_bin%\mysql -u aUSERNAME  -p

USERNAME is the MySQL administrator user. You will have to provide the password fro that user.

Your shell prompt should now look like this:

  1. mysql>

Run this command:

  1. grant all privileges on *.* to USER@IP identified by "PASSWORD";

USER is the username that you would like to give permissions for remote login.
IP is the public IP address of your remote connection.
PASSWORD is the password you would like to use for this username.

You now must flush MySQL\\\”s privileges. Run this command:

  1. FLUSH PRIVILEGES;

Run this command to exit MySQL:

  1. exit;
VN:F [1.9.18_1163]
Rating: 10.0/10 (2 votes cast)
How to allow remote connection to MySQL, 10.0 out of 10 based on 2 ratings

6 Responses to “How to allow remote connection to MySQL”

Leave a Reply