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:
- A MySQL client (e.g., Navicat, phpMyAdmin, Workbench, or Dreamweaver)
- Your server’s IP address
- Database credentials (name, username, password)
- Port 3306 (default MySQL port)
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.
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.
Write A Comment