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!

mysql connect to different server, replace localhost with ip address or server name?

Discussion in 'Database Discussion' started by m1ichael, Jan 17, 2014.

  1. m1ichael

    m1ichael Registered

    Nov 19, 2013
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Reseller Owner
    I am moving a number of ecommerce sites to a new server, I do not want to put them all off line on the old server, I would rather they a linked with the new database (so new usernames etc are collected in the new database).
    or people who have the old IP address stuck in their cache are automatically directed to the new IP which I do not think is a possibility.

    I see that I can give access to my old server IP address to access my MySQL on my new cpanel.
    But I do not know if simply changing localhost to the ip address of my new host will work, I have not tested it but I think not? maybe there is a server name that can be used?

    I am using zencart. After I have given access to the old host IP address, is there anything I can use in here
    define('DB_SERVER', 'localhost');
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Apr 11, 2011
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    Hello :)

    You can import the databases and database users into the new server and then setup a remote MySQL server on the source server via:

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

    Documentation on this feature is available at:

    Setup Remote MySQL Server

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

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