Skip to main content

How to Whitelist IP Addresses for Remote MySQL Connections

In order to allow MySQL database connections, you need to add the IP from which you wish to set up the connection. Here’s how you can do it.

Usama Zafar avatar
Written by Usama Zafar
Updated over 2 weeks ago

Remote database connections are an essential requirement for many projects. However, on Cloudways servers, remote connections to MySQL are not allowed because of the inherent security risks to the servers and applications.

In order to allow MySQL database connections, you need to add the IP from which you wish to set up the connection. Please note if you are using MySQL over SSH, there is no need to whitelist your IP.

TL;DR? Read the summary of this article:

  1. Open Remote MySQL access settings – In your Cloudways Dashboard, select the specific application and navigate to the Remote MySQL section.

  2. Add IP addresses or ranges – Enter the IP addresses or CIDR ranges you want to whitelist for remote database access, then save to apply changes.

  3. Connect using your whitelisted IP – After adding the IP, you can connect remotely from that address using a MySQL client over a secure TCP‑SSL connection.

  4. Alternative access methods – You can also choose to use SSH tunneling or the Cloudways web-based database manager for secure, convenient access without direct remote connections.

How to Whitelist IP Addresses for Remote MySQL Connections

Step 1: Go to Server Management

Log into the Cloudways Platform with your credentials. Click on “Servers” in the top menu bar. Then, click on your target server from the list.

Step 2: Whitelist Your IP and/or IP Subnets

  1. Next, go to the Security menu option on the left menu

  2. Click Shell Access.

  3. Select the MySQL tab.

  4. Add the IP address to the “Add IP to Whitelist” text area and click the “Add” button.

  5. If you have multiple IP addresses, repeat the process.

  6. Once you are done, click the “Save Changes” button to finalize the changes.

Now since you are done with whitelisting IP, please follow this KB to set up a remote MySQL database connection.

Important

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?