How To Use A Remote MySQL® Database With cPanel

There is a way to enable external web servers/computers to access your MySQL database. After permitting remote host access, you can connect to your MySQL database via client applications.

How to allow remote host access?

To enable hosts to explore your MySQL remotely, follow these steps:

Step 1: Log-in to cPanel

Log in to cPanel by going to https://[yourdomain.com]/cpanel or by going to https://clients.stablepoint.com and accessing cPanel through there.

Step 2: Access Remote MySQL

• Now you are in the home screen area of the cPanel. Locate the term Databases. While there, you will see Remote MySQL.

1224

https://blog.cpanel.com/wp-content/uploads/2021/01/00-cpanel-menu-remote-mysql.png

Step 3: Add Access Host

• After you click Remote MySQL, move to Add Access Host within the Host box. Enter the IP address of the remote server/computer you wish to grant remote access to your database. The IP will be allowed through our firewall and the relevant MySQL grants will be added to the access list.

Step 4: Add a comment

• It is optional to add a remark in the Comment text box. The remark can be a brief description of the new remote host you are about to give access to your MySQL databases.

Step 5: Finish

Lastly, click on Add Host to complete this process.

1294

https://blog.cpanel.com/wp-content/uploads/2021/01/01-cpanel-remote-mysql-manager.png

How to access the MySQL database from anywhere?

Some software can open an SSH tunnel to your MySQL database, so not requiring you to add each individual IP that needs. This is the best method if you have an IP address that changes regularly, but it also means that the connection is fully encrypted.

To do this, you will need to give the software (for example, MySQL Workbench) your cPanel username and password to establish an SSH connection to your hosting service first. You'll need the following credentials to establish an SSH tunnel for MySQL:-

SSH Username: your cPanel user
SSH Password: your cPanel password
SSH Port: 22

Database Username: a valid database user, created in cPanel
Database Password: the password corresponding to that user
Database Host: 127.0.0.1
MySQL Port: 3306