Page tree
Skip to end of metadata
Go to start of metadata

For cPanel & WHM version 64

Overview

This document describes additional steps to follow if you experience problems when you attempt to connect to your remote MySQL® server.

Error messages

The following table describes some errors that you may encounter, their possible causes, and the solutions we recommend:

ErrorPossible causeSolution
Failed to connect to remote server


DNS error: the server cannot resolve the hostname.

Verify your DNS configuration settings. For more information, read our DNS FAQ.

Invalid IP address error: the IP address does not exist.
  1. Confirm the local server's IP address network configuration. For more information, read our Installation Guide - Troubleshoot Your Installation.
  2. Confirm the remote MySQL server's IP address.
  3. Ensure that the remote MySQL server is responsive.
  4. Verify the local and remote server firewall configuration settings.
Incorrect SSH port.
  1. Confirm the SSH port on the remote MySQL server:

    # ss -pln | grep ssh
    LISTEN     0      128                      :::22                      :::*      users:(("sshd",1163,4))
    LISTEN     0      128                       *:22                       *:*      users:(("sshd",1163,3))
  2. Enter the correct SSH port for the remote MySQL server. In the example, the correct port is 22.
Invalid SSH credentials.Verify you have the correct username and password to access the remote MySQL server.
Unable to connect to remote MySQL host "IP", connection failed with error:  

Host 'hostname' is not allowed to connect to this MySQL server

Insufficient MySQL permissions.

Grant the user superuser access.

# mysql mysql
-snip-
mysql> CREATE USER 'user'@'hostname' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON *.* TO 'user'@'hostname' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)

Lost connection to MySQL server at 'handshake: waiting for initial communication packet', system error: 110 

Firewall error. The server cannot access the specified port on the remote MySQL server.

Verify your firewall configuration settings. For more information, read our How to Configure Your Firewall for cPanel & WHM's Services documentation.

Note:

The specific solution will depend on the configuration settings of the local server, remote server, and firewall utility.

Cannot connect to MySQL server on 'IP' (107)

MySQL is down on the remote MySQL server.Restart MySQL on the remote MySQL server. For more information, read our SQL Databases FAQ.
Incorrect MySQL port.
  1. Confirm the MySQL port on the remote MySQL server:

    # ss -pln | grep mysql
    LISTEN     0      50                        *:3306                     *:*      users:(("mysqld",3308,12))
  2. Enter the correct MySQL port for the MySQL server. In the example, the correct port is 3306.

     

 

Reverse DNS entry warning

Before you set up a remote MySQL server, ensure that the remote server can resolve your local server's hostname to its IP address. To confirm this, log in to the remote server via SSH and use the host command:

root@server [~]# host 208.77.188.166
166.188.77.208.in-addr.arpa domain name pointer www.example.com
root@server [~]#

If you do not have a reverse DNS entry configured for your hostname, add an entry for your hostname to the /etc/hosts file on the remote server.

For more information, read our How to Configure Reverse DNS for BIND in WHM documentation.

Remote MySQL root password

You can use the WHM interface to change the MySQL root password (Home >> SQL Services >> MySQL Root Password). If you use a remote MySQL server, you must choose whether you will change the local or the remote server's root password. By default, the system selects the remote MySQL server.

Note:

When the remote MySQL server is also a cPanel server, you must perform additional steps:

  • If you change the MySQL root password on the hosting server, you must update the remote MySQL server's /root/.my.cnf configuration file.
  • If you change the MySQL root password on the remote MySQL server, you must update the MySQL profile on the hosting server, and then re-activate the profile.

Additional documentation