Remote MySQL connection on cPanel hosting

Usually the site works with its database on the same server (localhost) and remote access is not needed. You need it to open the database in an app on your computer or to connect an external service.

1. Allow your IP address

  1. Find your computer public IP (for example, on whatismyip.com).
  2. Open "Remote Database Access" (group "Databases").
  3. Enter this IP in "Host" and a note in "Comment".
  4. Click "Add Host".
Allowing remote access for an IP
Allowing remote access for an IP

2. Ask support to allow your IP on the server

Outside connections to MySQL are closed by the server network filter. Open a support ticket with the IP from step 1 - support adds it to the allowed list. A static (permanent) public IP is required: if your provider changes the address, access stops after the change and the new IP has to be allowed again.

3. Connect

SettingValue
Hostyour domain or the account IP (cPanel home page)
Port3306
User and databasefull names with the prefix: example_shop
Passwordthe database user password

Do not add the host % (any address): bots will start guessing the password. Allow specific IPs only and remove them when access is no longer needed.

For one-off database work, phpMyAdmin in cPanel is easier - nothing needs opening for it: phpMyAdmin.

Questions and answers
Outside MySQL connections are closed by the network filter. Open a support ticket with your static public IP - it is added to the allowed list.
3306.