How do I create remote access to my MySQL database on my VPS server?

Procédure

Why should I allow remote access to my MySQL database?

You can configure your MySQL server so that it can be accessed from a remote server. This can be useful if you want your database server to be separate from your web server or other servers.

How do I create remote access to my MySQL database on my VPS server?

If your VPS server was delivered after 1 September 2013, the MySQL service is basically open to the outside world: you can therefore skip steps 1, 2, 3 and 4.

1. Connect to your dedicated VPS server using SSH

2. Edit the MySQL configuration file using the following command :

  • on Debian 8 and 9 :
Code
nano /etc/mysql/my.cnf
  • on Debian 10 systems :
Code
nano /etc/mysql/mariadb.conf.d/50-server.cnf


3) Modify and save the :

Replace the following line :

How do I create remote access to my MySQL database on my VPS server?


with

How do I create remote access to my MySQL database on my VPS server?


Then save the file :

How do I create remote access to my MySQL database on my VPS server?


4) Restart the MySQL server to save your changes, using the following command:

How do I create remote access to my MySQL database on my VPS server?


5) Connect to your ISPConfig management panel, under the "Sites" tab, "Database" section, "Add a database" button:

How do I create remote access to my MySQL database on my VPS server?


6) Tick Remote Access, then add your IP address(find out your IP address here) in the Remote Access IP field.

If you want to authorise more than one, separate them with commas. Leave blank to authorise everything:

How do I create remote access to my MySQL database on my VPS server?


7) Finally, you will need to open TCP port 3306 in your server's firewall. To do this, connect to your LWS Customer Area,

How do I create remote access to my MySQL database on my VPS server?

8. Click on"Servers".

How do I create remote access to my MySQL database on my VPS server?

9. Click on"Manage" behind the server for which you want to open the port.

How do I create remote access to my MySQL database on my VPS server?

10. Then select"Firewall":

How do I create remote access to my MySQL database on my VPS server?

11. Click on the"Open a new port or port range" button.

How do I create remote access to my MySQL database on my VPS server?

12. Specify the TCP port you want to open and click on the"Validate" button to save your request.

How do I create remote access to my MySQL database on my VPS server?

Video procedure


I want a technician to activate and configure remote access to the MySQL service on my VPS server. How do I do this?

For people who don't want to connect directly via SSH (it's easy to make a handling error), LWS offers managed services.

There are two solutions: either you have subscribed to a support option: this intervention is included in your package --> simply open an incident ticket with the technical department to indicate which IP(s) should be authorised.

Or, you can set up a one-off managed service: a technician will call you back within the hour and carry out the work with you. The technician will take the time to answer your questions and explain the changes you have made.

help.lws.net/a/482
Was this article helpful?

Yes

No

Read 52 879 times

Thank you! Feel free to ask questions about our documentation if you would like more information, and help us improve it.

Similar articles

A question about this article?

Ask the LWS team and the community. Answers are published after moderation.

Ask the LWS team and its community a question

GDPR: Controller: LWS-Ligne Web Services. Purpose: moderation and public publication of your question, possible notification of an answer. Legal basis: consent (Art. 6(1)(a) GDPR). Email retention: 90 days after notification, 12 months maximum without an answer. To exercise your rights, see the GDPR section of our Terms and Conditions.