By default a cPanel database only accepts connections from the hosting server itself (localhost). If you want to manage it from a desktop client such as HeidiSQL, DBeaver or MySQL Workbench, or let an app on another server read it, you must allow that computer's IP address in Remote Database Access.
Before you start
- A database and user created in cPanel. See create a MySQL database and user.
- The public IP address of the computer or server that will connect. Find yours with the MdmHost IP checker.
- The server's shared IP or hostname, shown in the General Information panel on the cPanel home page.
Add an allowed host
- Open cPanel → Databases → Remote Database Access (called Remote MySQL in older versions).
- In Host, enter the IP address, for example
203.0.113.25. You can also use a wildcard such as203.0.113.%for a whole range. - Add a Comment such as
office PCso you remember what it is. - Click Add Host. The IP appears in Access Hosts.
Important: Never add % on its own. It allows the whole internet to try passwords against your database. Add only the IPs you need and remove them when you are done.
Connect from your client
| Field | Value |
|---|---|
| Host | Your domain (if it points to MdmHost), the server hostname or shared IP |
| Port | 3306 |
| User | The prefixed database user, e.g. cpuser_app |
| Password | That user's password |
| Database | The prefixed database name, e.g. cpuser_shop |
Apps on the same hosting account must keep using localhost; only external connections use the domain or IP.
A safer alternative: SSH tunnel
If SSH access is enabled on your account, you can avoid opening MySQL to the internet at all. In DBeaver or HeidiSQL choose an SSH tunnel connection, connect to the server on port 22 with your cPanel username and key, then use 127.0.0.1 and port 3306 as the database host. See SSH access and keys in cPanel.
Troubleshooting
"Host 'x.x.x.x' is not allowed to connect"
The IP in the error is the one MySQL sees. Add exactly that IP in Remote Database Access. Home connections often change IP; update the entry when it changes.
Connection timed out
Your network may block outgoing port 3306, or the server firewall has not yet picked up the new host. Wait a few minutes and try again, then open a support ticket with your IP.
Access denied for user
The username or password is wrong, or the user has no privileges on that database. Check Manage My Databases → Privileged Users.
