Support article
Remote MySQL access in cPanel and DirectAdmin
Learn how to enable remote MySQL access in cPanel and DirectAdmin and which server value to use for a secure connection.
Introduction
Yes, you may be able to access your MySQL database remotely if your hosting plan, control panel and server security settings allow it.
Remote MySQL access lets you connect to a hosted database from another computer, an external application, another server or a tool such as MySQL Workbench.
Which server value should you use?
The server value is the address used by the application to connect to the database.
In many cases you can use one of these:
- Your main domain, for example
yourdomain.com. - The server hostname, for example
server123.mihosting.com. - The server IP address.
If you are not sure, check the service activation email, your client area or ask support.
What do you need before connecting remotely?
Make sure you have:
- The database name.
- A MySQL user with permission for that database.
- The user password.
- The server value.
- The port, when required.
Steps to enable remote access in cPanel
- Sign in to cPanel.
- Open the remote MySQL access section.
- Add the external IP address that will connect.
- Save the changes.
Steps to enable remote access in DirectAdmin
- Sign in to DirectAdmin.
- Open the MySQL management area.
- Review whether remote access is available for the account.
- Add or request the authorised IP if needed.
How to connect from MySQL Workbench
- Create a new connection.
- Enter the server, port, username and password.
- Test the connection.
- Open the database if the access is accepted.
Should I use the wildcard % to allow any IP?
It is usually safer to allow only the exact IPs that really need access instead of opening the database to every address.
Useful tips
- Only authorise known IP addresses.
- Use strong passwords.
- Remove remote access if you no longer need it.
Common problems when connecting remotely
Error: Access denied for user
Review the username, password and permissions.
Error: Connection timed out
Check the server value, port and whether the IP is authorised.
I do not know which IP to add
You need the public IP address of the computer or server that will connect.
Frequently asked questions
Can I connect to MySQL from another city or country?
Yes, if the hosting setup and authorised IP rules allow it.
Is the MySQL server always localhost?
No. localhost is common for local website connections inside the same hosting environment, but remote access often uses another server value.
Is the MySQL port always 3306?
It is common, but the exact value should be confirmed if needed.
Is it safe to enable remote MySQL access?
It can be safe if you restrict IPs and use strong credentials.
Conclusion
Remote MySQL access can be useful, but it should be enabled carefully and only when really needed.