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 connect to different server, replace localhost with ip address or server name?

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

  1. m1ichael

    m1ichael Registered

    Joined:
    Nov 19, 2013
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    654
    Trophy Points:
    113
    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.
     
Loading...

Share This Page