Symptoms
When attempting to login to the MySQL service on your server from a remote location the client returns an error like the following.
Error NO. 2003
Can't connect to MySQL server on '1.2.3.4' (10060)
Description
The error 10060 is returned by the MySQL client when a connection could not be established with the service on the system you are connecting to. This is commonly caused by a firewall block or network issue preventing the connection.
Workaround
To determine how to resolve this error, you will need to check if this is caused by a network failure or firewall block. If you are using a Linux OS on the connecting computer, you can test the connection with a tool like nmap. For example, the following command structure would perform a connection test to a server on the default MySQL port. Where 1.2.3.4 represents the server's IP.
nmap -sT 1.2.3.4 -p 3306
For more details on how to use the above command to test, see the following article.
How to use nmap to troubleshoot port connectivity issues
If the above command reports the connection test returned a result of filtered, this would indicate that a firewall is preventing the connection. It is common practice to secure the MySQL service by preventing inbound connections to its listening port in the firewall.
If this port has been closed in the firewall, you will need to allow the IP you are connecting from through this restriction. The method for this will vary depending on what firewall software is used. We advise discussing this with your system administrator to allow inbound connections to the port(by default this is 3306).
While cPanel does not provide firewall or iptables management software, we do have the following documentation that provides some examples of how to configures these on a default CentOS installation.