How to Remotely Connect to a MySQL Database
Remote database connection permits MySQL databases hosted on your account to be accessed by servers located remotely. This feature in cPanel comes in handy when you want other servers to be able to access your databases.
- Configuration Settings
- Remote MySQL Connection
- Remove Remote Access Host
- Database Management
- Summary
Remote MySQL Database Connection in cPanel
Configuration Settings
Use the following configuration settings for connecting to your database:
- Host name - (use the server IP address)
- Database name - (cpanelUsername_databaseName)
- Database username - (cpanelUsername_databaseUsername)
- Database password - (the password you entered for that database user)
- MySQL Connection Port - 3306
- TCP or UDP - either is fine
Remote MySQL Connection
To enable remote MySQL connection, the connecting computer must be added as an Access Host. Follow these steps:
- Log into cPanel and click the Remote MySQL icon under Databases.
- Type in the connecting IP address under Host and click the Add Host button.
You should now be able to connect remotely to your database.
Remove Remote Access Host
To remove a host from accessing databases on your server:
- Under Manage Access Hosts, click the trash icon next to the IP address you want to remove.
- If you are sure you wish to prevent the server from accessing your databases, click Remove Access Host.
Database Management
After whitelisting the IP to allow remote connection, you should be able to make the proper remote MySQL connection with the database's name and user found on cPanel's MySQL Databases page. The most common problem in connecting is due to an incorrect username and/or password. Please ensure the username you use matches the username created in the "MySQL Database" section of your cPanel. For examples of MySQL errors, please see the related article: MySQL Errors.
You will need a third-party application to access MySQL remotely. Some are free, and some cost money.
Summary
To ensure easy access to your MySQL databases, you can set up a remote database connection on your account. This guide outlines all the necessary configuration settings that you may need. Additionally, you can find helpful tips for troubleshooting any common connection problems by visiting the articles linked.
If you haven't created your databases, you can read our easy guide on creating and deleting MySQL. We'll help you get started right away.
If you need further assistance, feel free to contact us via Chat or Phone:
- Chat Support - While on our website, you should see a CHAT bubble in the bottom right-hand corner of the page. Click anywhere on the bubble to begin a chat session.
- Phone Support -
- US: 888-401-4678
- International: +1 801-765-9400
You may also refer to our Knowledge Base articles to help answer common questions and guide you through various setup, configuration, and troubleshooting steps.