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.

Remote mysql server

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

  1. bettinz

    bettinz Member

    Joined:
    Jun 17, 2011
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  3. bettinz

    bettinz Member

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

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  5. bettinz

    bettinz Member

    Joined:
    Jun 17, 2011
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  7. bettinz

    bettinz Member

    Joined:
    Jun 17, 2011
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  9. bettinz

    bettinz Member

    Joined:
    Jun 17, 2011
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page