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.
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
Next, go to the Security menu option on the left menu
Click Shell Access.
Select the MySQL tab.
Add the IP address to the “Add IP to Whitelist” text area and click the “Add” button.
If you have multiple IP addresses, repeat the process.
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.