Usually a database (Ex, MySQL Database) and a database management application software (Ex. phpMyAdmin) both reside on the same system/server; hence establishing a connection between them does not involve much of a hassle. However, if someone needs to access the database (hosted on the server) using a software installed on a personal computer or any other system/server, the need of the hour is to establish a Remote Database connection.
cPanel provides a powerful tool to establish such remote database connections, without compromising on the security front.
In this tutorial, we will get to learn the intricate details involved in working with cPanel’s Remote MySQL Database Connection wizard.
STEP-1: Locating Remote MySQL Section on cPanel Interface
Log in to cPanel using the credentials supplied by your hosting partner. Under the Database section, you will be able to locate “Remote MySQL” icon. Click on the icon.
STEP-2: Adding Access Host
There can be 2 circumstances depending upon the installation directory of your Database Administration Application (Ex. phpMyAdmin):
- The application is installed in the hosting panel of another domain,
- The application resides on the hard drive of a personal computer/web server.
Once you get inside cPanel’s Remote MySQL section, you will notice that there is an input text box titled “Add Access Host”. If you want to connect from another domain, you will need to input either the domain name or the IP address of the webserver on which the domain is hosted. In-case your intention is to establish a database connection from a standalone personal system, you must provide the system IP address and click on “Add Host” button. On successful addition of a new Host entry, you will be able to view the same on the “Access Host” table located at the bottom of the same page.
Make sure you have noted down 3 important things mentioned below, which your database administration application will require in order to establish the connection remotely:
- MySQL Server Name
- Name of the Database that you want to access
- A valid MySQL User Name and Password
(NOTE: Default database user password is same as your cPanel password, unless explicitly specified by you while creating the database user)
STEP-3: Validating the Remote Connection
Open your database administration console (phpMyAdmin application) from the remote system/domain which you have added as the Access Host. In order to let you connect to the database, you will now be asked to provide the database server name, name of the database and database user name/password.
Click on “Connect” button after providing the above mentioned details. As soon as the database server authenticates the correctness of information supplied by you, it will establish a secure connection to the intended database.
(NOTE: All these information about MySQL Server/Port/Database/User can be found inside your cPanel’s MySQL Databases section)
STEP-4: Removing an Access Host
Log in to cPanel and go to Remote MySQL section. On the bottom of the page, you will be able to find a list of all the remote locations that you had configured earlier. Find the relevant domain name/IP address and click on Close (‘X’) button.
A confirmation message may also be displayed depending on the version of your cPanel interface – click on “Remove Access Host” button over there to complete the procedure.