Databases

Allow remote MySQL connections in cPanel (Remote Database Access)

Let a desktop tool or another server connect to your cPanel MySQL database by adding its IP in Remote Database Access, with the right host, port and security tips.

IntermediatecPanel hosting2 min read

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

  1. Open cPanel → Databases → Remote Database Access (called Remote MySQL in older versions).
  2. In Host, enter the IP address, for example 203.0.113.25. You can also use a wildcard such as 203.0.113.% for a whole range.
  3. Add a Comment such as office PC so you remember what it is.
  4. 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

FieldValue
HostYour domain (if it points to MdmHost), the server hostname or shared IP
Port3306
UserThe prefixed database user, e.g. cpuser_app
PasswordThat user's password
DatabaseThe 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.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.