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.

Issues about Setup Remote MySQL server

Discussion in 'Database Discussions' started by Elfofdark, Feb 16, 2012.

  1. Elfofdark

    Elfofdark Member

    Joined:
    Mar 7, 2007
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    Hello again,

    I have test Setup Remote MySQL server and i have some questions:

    First i define two terms so i don't freak you out:

    MRS = Mysql Remote Server that is running on a remote server
    MCS = Mysql Cpanel Server that is running on localhost

    1. At this moment 16 Feb 2012, can i use debian as a host for MRS?
    I have tried and my wizard went ok no errors and i could make new databases/delete also users etc.
    In the wizard script are there some red hat based commands like yum? or rpm? i really want to understand why can't i use debian as a host for MRS so i can take a accurate decision.

    2. After i setup MRS, the MCS should automatically shutdown or he will run in background for databases used by system (like mailscanner etc) ?
    In my tests is still running and it is used by mailscanner and other programs. ALSO old sites still use databases from MCS even if i have a MRS setup and working. These old db used by websites dont appear in cpanel but are working. In other wards every new db it appears in CPanel after setup MRS, but dbs from MCS created before setup MRS still working in background but they don't appear in CPanel accounts.
    I know i need to migrate them manually but i was expecting not to work anymore after MRS setup.

    3. After all its ok but only one problem bother me:
    On MRS i already have 150 Databases and after ai set cpanel to use that server as MRS, i went to use:
    Database Map Tool

    I can import users already defined on MRS, and i can see those in cpanel accounts at mysql tab.
    But i cannot add databases from MRS (i always get the message: database_name cannot find in Database)

    It's like the script from Database Map Tool is searching on localhost not in MRS i guess but he can find users from MRS so it's not that...

    I have disabled prefix mysql
    I am able to connect from MCS command line with user and password to MRS and use remote db.
    I made a db from cpanel and made a user with privileges for that db.
    On MRS i add manually a new DB and add privileges for user to this new db (made from whm/phpmyadmin)
    Still "not found in Databse" at Database Map Tool.

    What should i do i have test this issue and retest for couple of hours.

    In other words what i am trying to do is this:
    Before cpanel i have 2 server:
    Server1: Apache php ftp
    Server2: Mysql
    Many websites have databases and those are stored in Server2.
    Now i have CPanel and i want to destroy Server1 and use CPanel.
    I want to keep Server2 like it is so i have set "Setup Remote MySQL server"
    Now i need to map those existent DBs from Server2 to websites account in Server1.
    I could do that with "Database Map Tool" But it doesn't work.

    Please help me i am exhausted i work for last 2 days at this problem my brain is on fire.
     
  2. Elfofdark

    Elfofdark Member

    Joined:
    Mar 7, 2007
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    I have an other information that will help:

    At this moment i cannot map CPanel-acount <=====> Database + user with priv from MRS.
    Reason database name no found in Database.

    On the other hand and this is very important: from CPanel acount if i try to add database or user that exists already on MRS, it gives me an error that user exist and database exists.

    So the comunication its ok CPanel does use MRS in every way possible even horde is using MRS.
    At this point every thing works ok except i cannot map database to cpanel account so that in MYSQL section in CPanel i would see the new db that wasn't created from CPanel but appears there because i use db map tool.


    Any ideas? Any one?
     
  3. Elfofdark

    Elfofdark Member

    Joined:
    Mar 7, 2007
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    Solution: Workaround:

    Step1: dump database and mysql users + privileges from MRS.
    Step2: remove database from MRS and user from mysql>user and privileges from mysql>db
    Step3: Add new database and user from cpanel account with exact same name. Password hash can be taken from mysql user+priv dump just copy paste hash password to WHM > phpmyadmin > mysql > user.
    Step3: restore dump with phpmyadmin from sql file made in Step1.

    Every thing should work ok and you don't need to change anything to site scripts because:
    1. mysql hostname is same as previous same old kinky sql dedicated server ip.
    2. user and password same because we have created them from CPanel account > Mysql using info from dumping mysql>user table in step 1
    we don't need mysql>db table because we make privileges from CPanel account / MySQL
    3. database name same because we have created in CPanel Account a database with same name as old database.

    With this work around we have a downtime to max 10min (this depend about how big is your client database)
    And you don't have to change nothing to site files like php connection functions details.

    This tutorial it is used for next situation:
    You need to set Remote MySQL Server and migrate websites from an other servers that already have databases on MRS full working and populated. I couldn't find any other solution in 2 days (this is 3rd)

    End OF Story, for additional informations please reply here.

    And one more thing CPanel === CAN === use as MRS a Debian or Ubuntu. And it works perfectly.
    CPanel Staff you might what to test it again and write to your documentation that you CAN use Debian/Ubuntu for MRS.

    Thank you very much for my support to CPanel Community :)
     
    #3 Elfofdark, Feb 17, 2012
    Last edited: Feb 17, 2012
Loading...

Share This Page