Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Remote mysql server

Discussion in 'Database Discussion' started by bettinz, Sep 21, 2014.

  1. bettinz

    bettinz Member

    Joined:
    Jun 17, 2011
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    51
    Hello,
    I'm looking for help, because I've found informations really old about that feature.
    I've setup a remote mysql server, and it works.
    Now it's time to move databases from local to remote server. Can someone tell me how to do that?
    Maybe something more painless than "stop mysql and copy with scp the /var/lib/mysql/ folder"?
    In cpanel documentation everything is explained for a "first setup" server, but what I do if my server is already up with 50 clients?
    Because in that situation is better to setup a new cPanel server with remote mysql server enabled and move old accounts without remote db to this new server.

    I've asked for a better integration and clustering with a "MySQL only" version of cPanel/WHM; I hope this help.
    MySQL Only version of cPanel & WHM | cPanel Feature Requests

    Thank you for the help
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,809
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello :)

    You will have to backup and restore the databases manually to the remote MySQL server, as that's not a transfer process facilitated by the cPanel software. The "mysqldump" utility will allow you to backup the databases:

    MySQLDump

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. bettinz

    bettinz Member

    Joined:
    Jun 17, 2011
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    51
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,809
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Have you setup the remote MySQL server option in Web Host Manager? It's located at:

    "WHM Home » SQL Services » Setup Remote MySQL Server"

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. bettinz

    bettinz Member

    Joined:
    Jun 17, 2011
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    51
    Yes, I've setup the remote DB, in fact I don't see localhost anymore, but I see the mysql server's IP.
    Now the situation is:
    - I've about 100 sites and accounts on localhost db and server
    - I've moved one site DB with scp to remote server
    - I've stopped mysql on remote server, the site work.
    - I've renamed the /var/lib/mysql folder with account name on localhost. The site not work anymore.

    It's nice if I can select which account to move, and move the accounts between server like zones with DNS Only.
     
  6. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,809
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Please ensure you have followed all of the steps listed at:

    Setup Remote MySQL Server

    Also, if the issue continues, try updating the configuration files for your scripts to use the IP/Hostname of the remote MySQL server instead of "localhost".

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. bettinz

    bettinz Member

    Joined:
    Jun 17, 2011
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    51
    Thank you, I've done everything, in fact I see the cPanel services using the remote db.
    What I've learned is that I don't need to edit my customers script and change server to remote ip.
    Can you confirm that?

    Thank you
     
  8. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,809
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    To clarify, are your websites with databases now functioning normally? If not, try updating the database configuration file on one particular website that is not functioning to see if that helps.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. bettinz

    bettinz Member

    Joined:
    Jun 17, 2011
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    51
    Yes, they are working perfectly with localhost. But they use local db.
    I have see that because if I have an account called "test", and I move /var/lib/mysql/test from local server to remote server, the site stop works.
    In a normal situation, and if remote server concept is to use a remote server, if I move the db for the account from local server to remote server, it use remote db.
    I can't change configuration files for over 100 accounts, maybe I start with a brand new server.
     
  10. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,809
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    It does not sound like you setup the remote MySQL feature correctly if the local MySQL server is still utilized. Feel free to open a support ticket using the link in my signature so we can take a closer look. You can post the ticket number here so we can update this thread with the outcome.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice