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.

mysql remote server connection - other threads dont help

Discussion in 'Database Discussions' started by davestacey, Nov 12, 2008.

  1. davestacey

    davestacey Member

    Joined:
    Nov 10, 2005
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    I am trying to connect to my own server (mysql), from another server i just bought.

    I searched the net to no avail, and this thread doesnt work for me (http://forums.cpanel.net/showthread.php?t=78345)

    I have added the new servers ip to my old servers firewall, and it still wont connect, i get this error.

    This is the php code i am using....


    Any simple instructions on how to do this please?

    Thanks!
     
  2. davestacey

    davestacey Member

    Joined:
    Nov 10, 2005
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
  3. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    1. Is MySQL on your SQL server configured to listen on TCP port 3306?

    2. Is your MySQL server accessible from your new server (e.g. you can ping the MySQL server from your new cPanel server)?

    3. Is the access GRANT for the MySQL user correct (e.g. the Host field either has % or the IP address/hostname connecting from)?
     
  4. davestacey

    davestacey Member

    Joined:
    Nov 10, 2005
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Hi Kenneth,

    Thanks for taking the time to answer my thread.

    1. yes, port 3306 is open in the csf firewall
    2. the new server is a shared non cpanel server, so i got the server admin to ping on my behalf and it pinged ok.
    3. yes this is setup


    Are there any other tests i can do from the new server to see if it can connect to the sql server?
     
    #4 davestacey, Nov 12, 2008
    Last edited: Nov 12, 2008
  5. davestacey

    davestacey Member

    Joined:
    Nov 10, 2005
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Still the same issue.
     
  6. me@linux

    me@linux Registered

    Joined:
    May 31, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Try this from new server, and see if you are able to connect.

    telnet oldserver.com 3306

    (Replace oldserver.com with your old servername/IP)
     
  7. anton_latvia

    anton_latvia Well-Known Member
    PartnerNOC

    Joined:
    May 11, 2004
    Messages:
    348
    Likes Received:
    3
    Trophy Points:
    18
    Location:
    Latvia
    cPanel Access Level:
    Root Administrator
    There are many things that can happen - firewall on your local server, firewall on the new serve blocking outgoing connections (do you have ConfigServer Firewall installed or may be default iptables rules are enabled?). Then your mySQL server might deny network connections, please give us content of /etc/my.cnf. Then - did you try to connect through shell? (mysql -h REMOTE_ADDR -u USERNAME -p). If this does not work - what exact error do you get?

    Anton.
     
Loading...

Share This Page