Remote MySQL in cPanel: external connections
Use cPanel Remote MySQL to whitelist trusted IP addresses, connect from external applications, and avoid exposing databases with wildcard access.
On this page
By default, cPanel MySQL databases are intended to be used by scripts on the same hosting account. Remote MySQL allows a trusted external server, application, or development IP to connect after you explicitly whitelist it.
When remote MySQL is needed
- An external application server needs to read or write to a cPanel database.
- A developer needs temporary database access from a fixed office or VPN IP.
- A reporting tool or utility connects from another server.
If the website and database are on the same cPanel account, use localhost instead of Remote MySQL.
Whitelist an IP address
- Log in to cPanel.
- Open Databases and choose Remote MySQL.
- Enter the trusted remote IP address.
- Click Add Host.
Use the public IP address of the remote server or network. A local/private address such as 192.168.x.x will not work for internet connections.
Connection settings
| Setting | Value |
|---|---|
| Host | Your server hostname or server IP. |
| Port | 3306 unless support has provided a different port. |
| Database | The full cPanel-prefixed database name, such as cpuser_app. |
| User | The full cPanel-prefixed database user, such as cpuser_appuser. |
| Password | The database user's password, not your cPanel password. |
mysql -h server.example.com -P 3306 -u cpuser_appuser -p cpuser_app
Security guidance
- Whitelist only specific trusted IP addresses.
- Avoid
%wildcard access on production databases. - Create a database user with only the privileges the remote app needs.
- Remove temporary IPs when the test, or developer task is finished.
- Do not share your cPanel password for database access.
Troubleshooting
| Problem | What to check |
|---|---|
| Access denied | Confirm database username, password, database privileges, and cPanel prefix. |
| Connection times out | Confirm the remote public IP is whitelisted and port 3306 is not blocked by the remote network. |
| Works locally but not remotely | Local scripts should usually use localhost; remote access requires the external host IP. |
| Dynamic IP keeps changing | Use a VPN/static IP or connect from a fixed server instead of repeatedly broadening the whitelist. |
Related: Creating and managing MySQL databases in cPanel | Using phpMyAdmin in cPanel-import, export, and manage databases | How to secure your website | Error establishing a database connection-diagnosis and fix
Need cPanel hosting or licensing?
Use UnderHost cPanel hosting or add cPanel/WHM to a VPS or dedicated server for familiar website, email, DNS, and database management.





















