Cantech Knowledge Base

Your Go-To Hosting Resource

Learn to configure Remote MySQL access in cPanel

Sometimes, you need to connect to your website database from a location outside of your hosting server. Well, with remote MySQL access, an external machine can connect to your database safely, and you can manage it easily without always logging into cPanel.

However, you need to configure some settings inside cPanel to grant permission for external connections. You set up which IP addresses or domain names can access the MySQL databases remotely. After this setup, you can use database management tools like MySQL Workbench or even command-line utilities to connect directly to your databases.

Let’s see the stepwise process below –

How to Add a Remote Host in cPanel for MySQL Access

This means you need to tell cPanel which remote machine can reach your database. Follow these steps properly for the same.

  1. You must first log in to your cPanel account and search for the Databases section. You will see an option called Remote MySQL there. You must click on it.
  2. Now you will see a page where you can add access for remote hosts. There will be a text box labelled Host. Here, type the domain name or the IP address of the machine that you want to allow.
    Important Note – You can simply open Google and type What is my IP to confirm the IP address. It will show you your current IP address instantly.
  3. In the text box called Comment, you can write a note about the remote host you are adding. For example – ‘Home’, ‘Developer’, etc. This step is optional, you can also leave it blank.
  4. After that, click on the Add Host button.

Now, your database will start accepting connections from that IP address or domain name.

How to Connect to Your Database Remotely

The above steps will give access to the remote host. So, you can connect to your MySQL database easily.

You must use a MySQL client tool such as MySQL Workbench, HeidiSQL, or even simple command-line utilities. Also, use your domain name or IP address as the database host, not just localhost, to set up the connection.

You must also enter your database username and password correctly. In some cases, your hosting provider may ask you to use a specific port number, so you must check that also once before connecting.

How to Remove a Remote Host from MySQL Access

If you no longer need a certain machine to access your database, you can remove the host access immediately. Here is how you can do it:

  1. First of all, you must log back into your cPanel account.
  2. In the Databases section, you must again click on Remote MySQL.
  3. You will now see a list under the Manage Access Hosts area. You must find the IP address or domain name that you want to remove.
  4. Click on the Delete link next to it.
  5. cPanel will then ask you for confirmation. After confirming, the host will no longer be able to access your MySQL databases.

This keeps your database secure by removing unwanted connections.

Important Things You Should Always Remember

Please note that giving remote access means you are opening your database to external sources. You should do it carefully by adding only trusted IP addresses or hosts.

Moreover, your hosting provider may block remote MySQL access by default. You must check their documentation if you face any connection issues. Also, your firewall settings need to give access to MySQL connections from connection to your own server or local machine.

June 18, 2025