Skip to main content

How to Allow a Remote IP Address to Connect to MySQL

You can allow a remote IP address to connect to your MySQL database in cPanel. This process allows you to manage your database from a remote location or application while maintaining security by restricting access to specific IP addresses.

You can allow a remote IP address to connect to your MySQL database in cPanel. This process allows you to manage your database from a remote location or application while maintaining security by restricting access to specific IP addresses.

Before you begin

You will need:

  • A cPanel account

  • The specific IP address of the remote machine (e.g., 192.0.2.10)

  • The name of the MySQL database and the MySQL username

Allow a Remote IP Address to Connect to MySQL

  1. Log in to your cPanel account.

  2. Locate the Databases section and select Remote MySQL®.

  3. Under the Host Access section, enter the IP address of the remote machine in the Host field.

  4. Enter the Username and Password for the MySQL account you wish to access.

  5. Click Add Host.

Confirm the result

  • The remote IP address will appear in the list of allowed hosts.

  • You can now connect to the database from the remote machine using the credentials provided.

If you cannot connect from the remote IP

If the connection fails after adding the host, check the following:

  • Incorrect IP: Ensure the remote machine is using the IP address you entered. If the remote machine has a dynamic IP, it may change, requiring a new entry.

  • Firewall Restrictions: Ensure that the server's firewall allows traffic on the MySQL port (typically 3306).

  • Incorrect Credentials: Verify that the MySQL username and password are correct.

Limitations

This feature allows you to whitelist specific IP addresses. If you do not know the specific IP of the remote machine or if it changes frequently, you may need to consult with Hostek to determine the best configuration for your specific use case.

Did this answer your question?