Loading...

Knowledge Base

How to Set Up a Remote MySQL Database Connection in cPanel

Remote database connection allows MySQL databases hosted on your account to be accessed by external servers. This feature in cPanel is especially useful when you want to offload database tasks or centralize database management across multiple servers.

Remote MySQL Database Connection in cPanel

Requirements

To connect remotely, you’ll need:

Configuration Settings

Use the following settings to connect to your database remotely:

  • Host Name: Your server’s IP address
  • Database Name: cpanelUsername_databaseName
  • Username: cpanelUsername_databaseUsername
  • Password: The password for the database user
  • Port: 3306
  • Protocol: TCP or UDP

If you haven’t created your database yet, refer to our guide on creating and deleting MySQL databases.

Remote MySQL Connection

To allow remote access:

  1. Log in to cPanel.
  2. Navigate to Remote MySQL under the Databases section.

    Remote MySQL icon under Databases
     

  3. Enter the IP address of the remote server or device in the Host field.

    Fields to add host
     

  4. Click Add Host.

You can use wildcards (e.g., 192.168.0.%) to allow a range of IPs, but ensure they are secure and under your control.

Remove Remote Access Host

To revoke access:

  1. Go to Manage Access Hosts.
  2. Click the trash icon beside the IP you want to remove.

    Trash icons under Remove column
     

  3. Confirm by clicking Remove Access Host.
If your IP address changes frequently (dynamic IP), you’ll need to update it each time.

Database Management

Once the IP is whitelisted, use your MySQL client to connect using the credentials found in cPanel’s MySQL Databases section. Common connection issues often stem from incorrect usernames or passwords. Double-check your credentials and ensure port 3306 is open.

Summary

Setting up a Remote MySQL Database Connection in cPanel allows you to manage your databases from anywhere using trusted tools and secure configurations. By following the steps above, you can ensure reliable and secure access to your MySQL databases. For further troubleshooting, check out our related article on MySQL Errors.

If you need further assistance, feel free to contact us via Chat or Phone:

  • Chat Support - While on our website, you should see a CHAT bubble in the bottom right-hand corner of the page. Click anywhere on the bubble to begin a chat session.
  • Phone Support -
    • US: 888-401-4678
    • International: +1 801-765-9400

You may also refer to our Knowledge Base articles to help answer common questions and guide you through various setup, configuration, and troubleshooting steps.

Did you find this article helpful?

 
* Your feedback is too short

Loading...