Global Header
3 Mins Read

How to Set Up a Remote MySQL Database Connection in cPanel

Home Blog WordPress Development 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 NamecpanelUsername_databaseName
  • UsernamecpanelUsername_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.

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

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.

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.

  • I’m Mohit Sharma, a content writer at Bluehost who focuses on WordPress. I enjoy making complex technical topics easy to understand. When I’m not writing, I’m usually gaming. With skills in HTML, CSS, and modern IT tools, I create clear and straightforward content that explains technical ideas.

Learn more about Bluehost Editorial Guidelines
View All

Write A Comment

Your email address will not be published. Required fields are marked *

Longest running WordPress.org recommended host.

Get Up to 61% off on hosting for WordPress Websites and Stores.