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.

How to Setup Remote MySQL ?

Discussion in 'General Discussion' started by nothingless, May 15, 2011.

  1. nothingless

    nothingless Registered

    Joined:
    May 14, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I have Server ONE current handle MySQL, I want use Server TWO handle all this MySQL and Server one only handle APACHE only. Both Server Install Cpanel (Centos). Anyone can tell me step by step to do this via WHM. Thank :D
     
  2. vanessa

    vanessa Well-Known Member
    PartnerNOC

    Joined:
    Sep 26, 2006
    Messages:
    817
    Likes Received:
    22
    Trophy Points:
    18
    Location:
    Virginia Beach, VA
    cPanel Access Level:
    DataCenter Provider
    In WHM, go to Setup Remote MySQL server - pretty self explanatory after that. It's listed step by step in the cPanel documentation:

    Setup Remote MySQL Server
     
  3. nothingless

    nothingless Registered

    Joined:
    May 14, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I read Document, and get this error. So how to resolve this ?

    Code:
        mysql started ok
    
    Done
    Testing new mysql setup...Failed to connect to the remote mysql host:
    
    /usr/bin/mysqladmin: connect to server at '85.17.x.x failed
    error: 'Can't connect to MySQL server on '85.17.154.x' (4)'
    Check that mysqld is running on 85.17.x.x and that the port is 3306.
    You can check this by doing 'telnet 85.17.x.x 3306'
    
    
    Restoring old mysql config. Please resolve the above error and try again. 
    
    
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Could you run the "telnet" command from your server as listed in the error message and post the results here?

    Code:
    telnet 85.17.x.x 3306
    Thank you.
     
  5. nothingless

    nothingless Registered

    Joined:
    May 14, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Code:
    root@ServeronOne [~]# telnet 85.17.x.x 3306
    Trying 85.17.x.x...
    telnet: connect to address 85.17.x.x: Connection timed out
    telnet: Unable to connect to remote host: Connection timed out
    
    Here is result via SSH telnet from ServerOne to ServerTwo
     
  6. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    983
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator
    Michael,

    Why does one need Telnet for remote MySQL? Surely this is VERY insecure?
     
  7. nothingless

    nothingless Registered

    Joined:
    May 14, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I resolved this 3306, cause by ServerOne install CSF and not open port TCP OUT 3306. BUt a problem arise:
    - I can't backup my db on ServerOne ( I used to backup succesfully with this, but after using remote , It's stop)

    Code:
    mysqldump: Got error: 1044: Access denied for user 'megxxx_for'@'66.x.x.x' to database 'megxxx_for' when selecting the database
    
    note: 66.x.x.x is ip ServerOne
     
  8. smoge

    smoge Well-Known Member

    Joined:
    Jul 2, 2004
    Messages:
    52
    Likes Received:
    0
    Trophy Points:
    6
    After switching to using remote SQL, the db connection will not work until you go to cpanel for that domain, and visit the mySQL page in cPanel... just load this page in your browser.

    I dont know if it is a bug, or by design - but I can say that you need to do this for each cpanel account, if you expect the db connection (username and password) to work.
     
Loading...

Share This Page