Skip to main content

How to Allow a Remote IP Address to Connect to MySQL or MariaDB

This article explains how to authorize a specific remote IP address to connect to your MySQL or MariaDB databases. This is necessary when you need to connect to your databases from an external application or a remote management tool.

This article explains how to authorize a specific remote IP address to connect to your MySQL or MariaDB databases. This is necessary when you need to connect to your databases from an external application or a remote management tool.

Important: This feature is only available on Hostek plans that include remote MySQL access.

Before you begin

You will need:

  • A Hostek account with the appropriate permissions to manage database settings.

  • The specific IP address of the remote machine (e.g., 1.2.3.4) that requires access.

Authorize a Remote IP Address

To allow a remote connection, you must whitelist the remote IP address within your hosting control panel.

  1. Log in to your Hostek cPanel.

  2. Navigate to the Remote Database Access feature in the Databases section.

  3. Find the Add Access Host field.

  4. Enter the remote IP address. Use the format 1.2.3.4 for a single IP or 1.2.3.0/24 for a specific subnet.

  5. Select Save or Update to apply the changes.

Confirm the result

To verify that the remote connection is successful:

  • Attempt to connect to the database from the remote machine using a tool like MySQL Workbench or a command-line client.

  • If the connection is successful, the tool will prompt you for the database password.

  • If the connection fails, ensure the remote IP address was entered correctly and that the port (typically 3306) is open on the remote machine's firewall.

If you receive an "Access Denied" error

If you receive an "Access Denied" error when attempting to connect from a remote location, check the following:

  • Incorrect IP: Verify that the remote machine's current public IP address matches the one entered in the control panel.

  • Incorrect Credentials: Ensure you are using the correct database username and password.

  • Port Blocking: Ensure that your local network or firewall is not blocking outgoing traffic on port 3306.

Limitations

  • This procedure only allows access from the specific IP address(es) provided. If your remote IP address changes (common with dynamic IP connections), you must update the allowed host list.

  • This does not change the password of the database user; it only modifies the permissions regarding which locations can attempt a login.

  • This does not grant permissions within the database (such as SELECT or UPDATE rights); those are managed separately within the database management tool.

Did this answer your question?