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.

Moved /var/lib/mysql and now cPanel cant use MySQL

Discussion in 'General Discussion' started by Cheater, Jun 20, 2005.

  1. Cheater

    Cheater Registered

    Joined:
    Feb 13, 2005
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    One of my sites has a absolutely massive database so I had to move it to /home.

    Now cPanel cant add/delete databases. :confused:
    phpMyAdmin works fine and so do all my php scripts.
    I have even deleted a user and then recreated it and it's databases still exist.

    I just did a simple mv and symlinked the dir to the new path.

    Any ideas?
     
  2. bmcgrail

    bmcgrail Well-Known Member

    Joined:
    Dec 8, 2003
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    6
    Not sure.
    It might have something to do with the permissions on /home. /home is not world or group readable.

    Try moving it to /usr

    My databases are in /var/db
    I moved them to /usr/var/db
    Did a sym link and everything works great.

    lrwxr-xr-x 1 root wheel 11 Feb 22 14:20 db -> /usr/var/db
     
  3. Myacen

    Myacen Well-Known Member

    Joined:
    Apr 6, 2002
    Messages:
    222
    Likes Received:
    0
    Trophy Points:
    16
    If you moved the full mysql folder over:

    ln -s /home/dbfolder /var/lib/mysql/dbfolder
     
  4. gfmorris

    gfmorris Member

    Joined:
    Jun 6, 2003
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Huntsville, AL, USA
    Thanks for the advice on this; my /var/lib/mysql was really choking the var partition, and I'm going to give this a whirl.

    Am I to assume that the safest way to do this is to shutdown mysqld, move /var/lib/mysql into /home, edit my.cnf, set a symbolic link, and then start mysqld again?

    Thanks in advance for any future advice.

    GFM
     
  5. Game Wizards

    Game Wizards Active Member

    Joined:
    Apr 6, 2003
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    Yea, shut it down, cp -Rf --preserve=all /var/lib/mysql/* /whatever/whereever/, possibly move /var/lib/mysql to /var/lib/mysql-bak for the time being, then symlink the dirs. Works fine here.
     
Loading...

Share This Page