There may be times when you have to connect to the database from outside your work network and if that's the case, you need to connect to your database using third party software that does not run on the server (i.e. a MySQL client on your desktop). This is referred to as making a remote MySQL connection. To do this, however, you will first have to allow the connection from within cPanel for the IP address you are connecting from. Read on to learn how.
Adding an IP address to allow a remote MySQL connection
First, you will need to make sure you have the IP address that will be accessing the database. These rules protect the database by only accepting external connections that you have set up. If you are connecting to a database from your current connection, get your IP address by clicking here, then follow these steps:
- Log into your cPanel web hosting control panel.
- Click the Remote MySQL button in the Databases section.
- Enter your IP address in the Add Access Host section.
- Click the Add Host button. You will then see a message stating the host IP address was added to the access list.
Using a Wildcard to add a range of IP Addresses
You may find you need to use a wildcard if your IP address changes regularly. You can add a wildcard by using the % symbol. This will add all IP addresses in that range. For example, if you want to list all IP addresses in the range 188.8.131.52 to 184.108.40.206 you'd add the IP address 174.77.92.%.