WordPress operates within a MySQL database, where all your content resides, making your site special and unique. If you want to extract your WordPress site, you will need to access its MySQL database.
Configuration Settings for Remote MySQL Database Connection
To connect to a MySQL database remotely, ensure you have the following configuration settings ready:
- Host Name: Your server's IP address.
- Database Name: The database name associated with your cPanel username.
- Database Username: The username for your cPanel database.
- Database Password: The password for your database user.
Note: You can find your database credentials in the WordPress root folder. Navigate to File Manager → public_html → wp-config.php and open the file to view your credentials.
- MySQL Connection Port: 3306 (TCP or UDP is acceptable).
How to Set Up a Remote Connection to Your Database
By default, servers restrict remote access to their databases, allowing connections only from specific IP addresses. Therefore, you need to add your IP address to the whitelist. If your IP address changes frequently, consider using a hostname or updating the connecting IP in Remote MySQL each time it changes. Ensure the connecting computer is enabled as an Access Host before attempting to connect to MySQL from another computer.
Steps to Set Up a Remote Connection:
- Log into cPanel.
- Click the Remote MySQL icon under the Databases section.
- Enter your IP address (you can find your current IP address at whatismyip.com).
- Click Add Host. You should receive a confirmation message stating Access Host Added, indicating that you can now connect remotely to your database.
Removing Remote Access to Your Database
To revoke access for a remote server to your database, follow these steps:
- Log into cPanel.
- Click the Remote MySQL icon under the Databases section.
- Click the X icon next to the IP address you wish to remove.
- Click Yes to confirm.
Important: Ensure the credentials match the username created in the MySQL Database section of your cPanel to avoid connection issues. Once the IP address has been whitelisted, you should be able to access MySQL remotely using third-party applications like Workbench, phpMyAdmin, etc. Some of these applications are free, while others are paid.