How to Setup MySQL Remote Connection to Database

A comprehensive guide on how to set up MySQL Remote Connection to your Database.

Emmad avatar
Written by Emmad
Updated over a week ago

Table of Contents

Remote MySQL connections are an essential feature of many projects. Many users prefer to use a MySQL client to set up the connection.

This KB describes the process of setting up remote connections to MySQL on your server using a MySQL client.

For the purpose of this KB, we will use MySQL Workbench. However, you are free to use any MySQL client of your choice.

Important

Before setting up these connections, you first need to add your IP and/or IP subnets to the whitelist. Please follow this KB article for whitelisting your IPs.

Set up Remote MySQL Database Connections

Once the IP address is whitelisted, you could use it to set up remote connections to the MySQL database.

Step 1: Get Database Access Credentials

You need to have database access credentials and the IP of the server that hosts the MySQL database. For this go to Applications > Application Details. Copy the database credentials (username and password) and the server’s IP address.

Classic Interface

New Interface

Step 2: Establish a Remote Direct Connection Using MySQL Client

Launch the MySQL client and set up a new connection. Enter the following information in the relevant fields:

Connection Name: You could use any name for your connection.

Hostname: Enter the IP address of the server that hosts the MySQL database.

Username: Enter the username.

Next to the Password, click the “Store in Vault” button and enter the password.

Step 3: Test the Connection

Once you have entered all the information, click the “Test Connection” button to check the connection. You will see the following success message:

You now have a working connection to your MySQL database from a remote IP address.

Important Note

  • Cloudways offers several options to access the MySQL database, including a web-based database manager and SSH tunnel for MySQL clients.

That’s it! We hope this article was helpful. If you need any help, then feel free to search your query on Cloudways Support Center or contact us via chat (Need a Hand > Send us a Message). Alternatively, you can also create a support ticket.

Did this answer your question?