Need help? Chat now!

Hostwinds Tutorials

Search results for:


Table of Contents


Enable Remote MySQL
Adding MySQL Remote Access Hosts
Common Settings
Testing a Connection

Remote MySQL in cPanel

Tags cPanel,  MySQL 

Enable Remote MySQL
Adding MySQL Remote Access Hosts
Common Settings
Testing a Connection

cPanel provides you the ability to connect to the databases on your account from another location. We are happy to offer Hostwinds clients the ability to use this feature in our Shared and Business web hosting services. Additionally, you can use any software that can connect to a MySQL database and then modify and update the database through the software making managing your database even easier for you to do. This article will go over how to enable Remote MySQL access for your account.

Enable Remote MySQL

Login to your cPanel Account. You can do this using the link sent to you via email when the plan was initially purchased.

Adding MySQL Remote Access Hosts

To utilize Remote MySQL, you will need to add the connecting IP to the whitelist for your account. You can do this through the cPanel under the Remote MySQL icon in the Databases section.

Once on this page, you'll want to enter the host's name (fully qualified domain name) or the system's IP making the connection, and click Add Host. Once you have added the host IP, click on 'Add Host.'

You may use the percentage sign character (%) as a wildcard. For example, to allow access from all IP addresses that begin with 104.12.43., enter 104.17.43.%.

Once a Host has been added, you can also Delete the Access Host by clicking on the Delete button.

Common Settings

Host or Server

Either 1) Your domain name or 2) Your Dedicated IP

Port

3306

Username

The database user that you have added to the database

Password

The database user's password

Database

The name of the database

Testing a Connection

If you would like to test the connection to your Database, you can use the following code snip-it to create a PHP file that you can run. It will tell you if the connection was successful or if there was an error. Once it is connected, it will close the connection.

connect_error){
    die("Connection failed: " . $conn->connect_error);
}

echo "Connected successfully
";

// Close the connection once finished.
$conn->close();
echo "Connection now closed successfully";

?>

Written by Hostwinds Team  /  June 5, 2021