Step 1: Allow the remote host in cPanel
- Log in to cPanel.
- In the Databases section, click Remote MySQL.
- In the Add Access Host field, enter the IP address of the machine that will connect.
- You can use the % wildcard (for example, 203.0.113.%) to allow a range.
- To find your current IP, visit http://ipfinder.us.
- Click Add Host.
Step 2: Connect from the remote application
Use these connection details:
Example from the MySQL command line:
Troubleshooting
- Connection refused / timeout: the remote host’s IP isn’t in the allowed list, or a firewall between you and the server blocks port 3306. Double-check the IP you added — if you’re on a dynamic connection, your IP may have changed.
- Access denied: the username/password is wrong, or the database user isn’t assigned to the database in cPanel (MySQL Databases → Add User To Database).
- Works locally but not remotely: make sure you’re using the full prefixed username (cpuser_dbuser), not just dbuser.
For security and latency reasons, keep the application and database on the same server where possible. Use remote MySQL for management tools, reporting, and integrations rather than as the primary application connection.