Remote MySQL connection

Sometimes, you would need to enable a user to connect to a MySQL database remotely and, though it may seem somewhat complicated, it really is not, requiring root access and just a few commands.

Firist of all you should know the IP of the user connecting to it, which you can see at or similar services.

After this, you would need to allow it to connect, which requires the follwing procedure:

*Log into your MySQL server, using the command: mysql -u root -p
You will get promted for the password, where you can use the root password

*Grant permissions to the remote user
GRANT ALL ON YourDatabase.* TO [email protected]’IP’ IDENTIFIED BY ‘user_password’;

To test it, you would need to run the following command, preferrably on a different server:
mysql -u RemoteUser -p -h IP
After this, you should be requested to enter the password.

Please note that the remote connection port for MySQL is 3306, which would need to be open on your server to connect to it.


  • mysql, remote, remote mysql
  • 84 Users Found This Useful
Was this answer helpful?

Related Articles

What happens if I go over my bandwidth limit?

You will get a notification when you've reached 90% of your allocated bandwidth. If you reach the...

How do I add more bandwidth?

There are two ways you can add more bandwidth.1.) You can upgrade your account to add more...

How does DDoS protection work?

We provide DDoS filtering up to 10 Gbps included with all of our VPS plans at all locations. If...

Do you create backups of the VPS?

We do a snapshot backup of every VPS to dedicated backup server. This snapshot backup is for...

How do i set reverse DNS (PTR) on my ip address?

In order to set rDNS on your IP please open a ticket to our support department and we will apply...