Cloud Service >> Knowledgebase >> General >> Learn to configure Remote MySQL access in cPanel
submit query

Cut Hosting Costs! Submit Query Today!

Learn to configure Remote MySQL access in cPanel

One of the most efficient open-source and relational database management systems (RDBMS) is a function of the MySQL, which is widely used in making websites that serve the purpose of web applications. cPanel is a full management web hosting control panel which is provided with multi faceted user interface to mange your web hosting account such as databases.

 

In some meantions, you may require your MySQL database to be remoted when developing the apps or when you’re working with a team members scattered in different locations. By default this confines on a possibility to access remote MySQL databases for security reasons. Furthermore, you could also set up remote access making reference to the steps and instructions outlined in this particular guide.

Prerequisites

Bear in mind, please, that next you need:

 

  1. A cPanel hosting account

  2. Access to the cPanel dashboard

  3. Of a remote machine whose IP address or hostname you want to use to access your database then select IP address or hostname instead of 127.0.0.1 or local host.

Step 1: Access the Remote MySQL Interface

  1. Open your cPanel control panel by following the link in the email you received after registration.

  2. Click on the icon for "Databases" and there go after "Remote MySQL".

Step 2: Add Remote Access Host

  1. In the Remote MySQL interface, scroll down to the "Remote Access Hosts" section.

  2. Click on the 'Add host' button.

  3. In the "Add Remote access host " popup, input the IP address of the remote machine you want to grant your MySQL database remote access.

  4. Click the " Add Host" button to apply the modifications.

 

Note: If you wish to allow access from several remote hosts click and type both the IP addresses or hostnames as appropriate.

Step 3: Assign Remote Access Permissions

  1. 'Remote Access Hosts' section is the place where you need to trace the IP address or hostname that has just been added and click the quote "Edit Permissions" link placed next to it.

  2. In the "Edit Remote MySQL Permissions" popup window you are going to find the list of MySQL databases that you have.

  3. For each database you want to grant remote access to, select the desired permissions (All Privileges, Select Only, etc.) from the corresponding dropdown menu.

  4. Click the "Make Changes" button to apply the permissions.

Step 4: Test Remote Access

  1. Install client for MySQL (if you do not have it) on the remote machine. Say, it might be mysql client launch on Ubuntu by following command:

 

sudo apt-get install mysql-client

 

  1. After the MySQL client has been installed, the client can now connect to remote MySQL database by using a command below:

 

mysql -h your_server_hostname_or_ip -u your_database_username -p

Replace your_server_hostname_or_ip with the hostname or IP address of your cPanel server, and your_database_username with the username of the database you want to access.

 

  1. Make use of enter the password of the data user after being prompted.

 

As soon as the connection is complete, you should see the MySQL prompt appear with you having successfully remote connected your MySQL database.

Advanced Configuration

Allowing Remote Access to a Specific Database User

 

To get a remote user MySQL access, you do not need to give all users the corresponding right. Simply click the next sentences for the detailed instructions:

 

  • Starting with the "cPanel" screen you access the "My SQL Databases" option where you can continue with.

  • Click the database hosting's link “Go to Remote MySQL Access Hosting” if you have chosen the database to which you want to create remote access permissions.

  • In the "Remote MySQL Access Hosting" interface, scroll down to the "Remote MySQL Access Only" section.

  • Click "Add Host". Furthermore,

  • In "Add Remote Access Host" pop-up, enter the IP-address or name of the remote machine which has to be used for granting its access.

  • Press "Add Host" button to save any edits.

 

Using this permissions setup, the settings of the selected MySQL database will be available, the user will log in and use a specific authentication method.

 

Configuring Remote Access via SSL/TLS

 

And to have an addition of security the remote access MySQL can be configured to use SSL/TLS encryption. It provides that the data sent between the client and server is encrypted, and thisismuch safer from eavesdropping during transmission or the man-in-the-middle attacks.

 

To establish the SSL/TLS security protocol for remote MySQL access, adhere to the preceding steps.:

 

  • In the cPanel dashboard, go to the "SSL/TLS Status" link. On the interface, click on the "Issue" button to issue a new certificate.

  • Scroll down to the "MySQL" section, and at the bottom of the page click on the "Purchase an SSL/TLS Certificate" link.

  • Provided with the indications set out, purchase and configure a firewall for your MySQL server.

  • After those installations have been completed, return to the "Remote MySQL" interface.

  • Look for the "Remote Access Hosts" part in which, locate the IP address or hostname you need to configure for SSL/TLS access, and click the "Edit Permissions" link next to this one.

  • The settings of the "Edit Remote MySQL Permissions" popup should be changed so that the "SSL Required" option is specified for the databases you need to use securely.

  • Click "Establish changes" for activation of the SSL/TLS configuration.

 

SSL/TLS can be activated after which the connection between the remote MySQL database and MySQL client may be made using a client that can hold SSL/TLS connections.

 

This instruction offers a basic method of remotely configuring MySQL in cPanel that will help you to manage databases from different locations and to team up with your team easier than usual. Do not forget to allow yourself to take a step back and increase the project's security factors including using strong passwords and a regular database backup to make the data secured and protected.

 

Cut Hosting Costs! Submit Query Today!

Grow With Us

Let’s talk about the future, and make it happen!