Knowledgebase

Setting Up Remote MySQL Access Print

  • cpanel, database, ipaddress, domain, security, password, troubleshooting, guide
  • 0

By default the database only accepts connections from the server itself. Remote MySQL allows a specific outside address to connect, which is useful for desktop tools and external applications.

ALLOWING AN ADDRESS

  1. Find the IP address that will connect. Visit whatismyip.com from that machine.
  2. In cPanel open Remote MySQL under Databases.
  3. Enter the IP address under "Add Access Host".
  4. Add a comment so you remember what it is for.
  5. Click Add Host.

CONNECTING

  • Host: your domain name or the server hostname
  • Port: 3306
  • Username and password: the database user you created
  • Database: the prefixed database name

Grant that user only the privileges it actually needs.

SECURITY CONSIDERATIONS

Never enter % as the access host. That allows the entire internet to attempt connections to your database. Home and office connections usually have dynamic IP addresses that change, so an entry added today may stop working tomorrow. Remove stale entries. Prefer an SSH tunnel over direct remote MySQL where your plan includes SSH access. Remove access hosts as soon as the work is finished.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot