Problem with Remote mysql

lifesecond

Registered
Mar 4, 2017
2
0
1
Italy
cPanel Access Level
Website Owner
Hello,
I'm new here and sorry for my English...:)

I want to connect to the database of cPanel from another host.
I added the host access ('%') but when I try to connect to it, the browser show me this error:
"Warning: mysql_connect (): Unable to establish connection. Incorrect response of the connected parties after the interval or failure response from the host is connected."

Does anyone know what I have to do to connect properly?

Thanks in advance,
Life
 

Jcats

Well-Known Member
PartnerNOC
May 25, 2011
806
156
168
New Jersey
cPanel Access Level
DataCenter Provider
You need to speak with both hosts, most hosts by default will block access to port 3306 to prevent attacks.

Do you have SSH access? You can try to connect using SSH to test:

Code:
# mysql -u $dbuser -p $dbname -h $remoteserver
hit enter, it will ask for the db user password, enter it in, then see what happens, it will most likely timeout which would mean a firewall issue.
 

lifesecond

Registered
Mar 4, 2017
2
0
1
Italy
cPanel Access Level
Website Owner
You need to speak with both hosts, most hosts by default will block access to port 3306 to prevent attacks.

Do you have SSH access? You can try to connect using SSH to test:

Code:
# mysql -u $dbuser -p $dbname -h $remoteserver
hit enter, it will ask for the db user password, enter it in, then see what happens, it will most likely timeout which would mean a firewall issue.

I don't have SSH access....o_O
but the documentation of cPanel (Remote MySQL - Documentation - cPanel Documentation) says:

Allow a remote server to access your databases
To specify remote hosts that can access MySQL databases on your account, perform the following steps:

  1. Enter the host’s name or IP address in the Host text box.

    Notes:
    • You may enter a fully qualified domain name (FQDN) or an IP address.
    • You may use the percentage sign character (%) as a wildcard. For example, to allow access from all IP addresses that begin with 192.68.0, enter 192.68.0.%.
  2. Click Add Host.
Why if I follow these steps I can't connect?
I don't understand...:confused:
 

Jcats

Well-Known Member
PartnerNOC
May 25, 2011
806
156
168
New Jersey
cPanel Access Level
DataCenter Provider
Because that has no control over your host's firewall, if they block access to port 3306 then although doing what the documentation says is needed, its irrelevant in the sense that the connection isn't being allowed by the firewall. So my suggestion remains.

You need to speak with both hosts, most hosts by default will block access to port 3306 to prevent attacks.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
Hello,

You'll need to check with your hosting provider to verify access over port 3306 is permitted, as mentioned in the previous post, as it's possible your hosting provider is blocking the port in the system firewall rules. Let us know the outcome.

Thank you.