By default, MySQL databases in cPanel only accept local connections. To allow external applications (like desktop clients or remote servers) to connect, you must configure Remote MySQL Access.

Important Security Note

  • Enabling direct remote access to MySQL databases can be a security risk.

  • A safer alternative is to tunnel MySQL connections over SSH.

  • Only whitelist trusted IP addresses.

 

Step 1: Request Port Access

  1. Open a support ticket in the Hosting Panel.

  2. Ask Support to enable inbound access to MySQL port 3306 for your account.

  3. Wait for confirmation that MySQL remote access is enabled.

 

Step 2: Add Remote Host in cPanel

  1. Log in to cPanel.

  2. On the Tools page → Databases section, click Remote Database Access.

    • If using cPanel v118 or earlier → click Remote MySQL.

  3. Under Add Access Host:

    • Enter the domain name or IP address of the remote host.

    • To allow local loopback, enter 127.0.0.1 (not localhost).

    • (Optional) Add a comment to describe the host.

  4. Click Add Host.

 

Step 3: Connect Remotely

  • Use a MySQL client (e.g., MySQL Workbench, phpMyAdmin, or command line).

  • Provide:

    • Hostname → your server’s domain/IP.

    • Port → 3306.

    • Username → MySQL user created in cPanel.

    • Password → MySQL user password.

    • Database name → the database you want to access.

 

Step 4: Remove Host Access (Optional)

  1. Log in to cPanel → Remote Database Access.

  2. Under Manage Access Hosts, locate the host.

  3. Click Delete → Remove Access Host.

  4. The host is removed and can no longer connect.

 

 

Was this answer helpful? 0 Users Found This Useful (0 Votes)

Powered by WHMCompleteSolution