How to Connect to MySQL Remotely in cPanel
Connecting to MySQL remotely through cPanel provides you with the flexibility to manage your databases from a different location or application. This guide will walk you through the steps to connect to your MySQL databases remotely using cPanel.
Step 1: Access cPanel
Start by logging into your cPanel account using your credentials.
Step 2: Locate the “Remote MySQL” Icon
Within the cPanel dashboard, navigate to the “Databases” section and find the “Remote MySQL” icon. Click on it.
Step 3: Add an IP Address
- In the “Add Access Host” section, you can specify an IP address that is allowed to remotely connect to your MySQL databases.
- Enter the IP address you want to grant access to in the “Host” field.
- Click on the “Add Host” button.
Step 4: Confirmation
You will receive a confirmation message indicating that the IP address has been added successfully.
Step 5: Remote MySQL Access
You can now connect to your MySQL databases remotely using the specified IP address.
Step 6: Configure Your Website/Application
- Next, you should configure your site to use the remote database. The process differs depending on the application you are using.
- For example, if you have a newly installed WordPress site, you would first create the database in cPanel’s MySQL® Database Wizard.
- Then, edit the WordPress site’s
wp-config.php
file to include the database name and authentication credentials, as well as the server’s domain name or IP address. Here’s an example:
define( 'DB_NAME', 'wp_database' );
define( 'DB_USER', 'user' );
define( 'DB_PASSWORD', 'a-secure-password' );
define( 'DB_HOST', '203.0.113.0' );
Note:
- Ensure that you are entering the correct IP address in your application’s configuration.
- Always consider the security implications of allowing remote MySQL access and only add trusted IP addresses.
By following these steps, you’ll be able to set up remote MySQL access in your cPanel, allowing you to manage your databases from external locations or applications. Make sure to exercise caution when configuring remote MySQL access to maintain the security of your databases. If you have any questions or encounter any issues, please refer to this guide for assistance. You’re now ready to connect to your MySQL databases remotely through cPanel.