Introduction
By default, MySQL databases on your hosting server are only accessible locally—meaning scripts and apps must run on the same server to connect to the database. If you need to connect to your database from an external server, development machine, or third-party service, you’ll need to enable Remote MySQL access in cPanel.
This guide explains how to securely set up remote access to your MySQL databases using cPanel's Remote MySQL feature.
Common Use Cases for Remote MySQL Access
-
Running database management tools from your local computer
-
Allowing an external app or website to connect to your database
-
Managing data from remote software like MySQL Workbench or phpMyAdmin
-
Connecting cloud services to your hosting database
Step-by-Step: Allow Remote Access to a MySQL Database
1. Log in to cPanel
Go to your hosting provider and access your cPanel dashboard.
2. Go to Remote MySQL
-
Scroll to the Databases section
-
Click on Remote MySQL
3. Add a Remote IP Address
-
In the field labeled “Host (%)”, enter the IP address that you want to allow access
-
Example:
203.0.113.5
-
To allow access from any IP, enter
%
(not recommended for security)
-
-
Click Add Host
✅ Tip: If you're unsure of your computer’s IP, search “what is my IP” on Google.
4. Confirm IP Whitelisting
After adding the IP, it will appear in the list of Access Hosts. This tells your MySQL server to accept connections from that IP.
Step 4: Configure Your Remote Client
To connect remotely, you’ll need the following:
-
Database hostname: Usually your domain name or server IP (e.g.,
yourdomain.com
) -
Database name
-
Database username and password
-
Port:
3306
(default MySQL port)
Use a tool like:
-
MySQL Workbench
-
DBeaver
-
Navicat
-
Or custom scripts using languages like PHP or Python
Security Tips
-
Only allow trusted IP addresses
-
Remove access when it's no longer needed
-
Use strong database passwords
-
Don’t use
%
as a host unless necessary (it allows any IP to connect)
Troubleshooting
Issue | Solution |
---|---|
Cannot connect remotely | Ensure your IP is added in Remote MySQL |
Connection timed out | Confirm port 3306 is open on your firewall |
Access denied | Double-check username/password and database permissions |
Wrong host | Use your server’s IP or hostname, not "localhost" |
Conclusion
Remote MySQL access in cPanel gives you flexibility to manage and connect to your databases from outside your server. Whether you're connecting development tools, external apps, or cloud services, enabling this feature properly ensures secure and functional remote connections.