The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Problem with Remote mysql

Discussion in 'Database Discussions' started by lifesecond, Mar 4, 2017.

Tags:
  1. lifesecond

    lifesecond Registered

    Joined:
    Mar 4, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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
     
  2. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    588
    Likes Received:
    88
    Trophy Points:
    153
    Location:
    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.
     
  3. lifesecond

    lifesecond Registered

    Joined:
    Mar 4, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Italy
    cPanel Access Level:
    Website Owner

    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:
     
  4. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    588
    Likes Received:
    88
    Trophy Points:
    153
    Location:
    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.

     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,204
    Likes Received:
    1,297
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page