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.

Change mysql database directory

Discussion in 'General Discussion' started by Kailash1, Mar 19, 2008.

  1. Kailash1

    Kailash1 Well-Known Member

    Joined:
    Nov 27, 2006
    Messages:
    252
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hi,

    I have stored Mysql database in /var/lib/mysql location and now /var is about to reach its allocated space. Is there any way I can change the location and move the existing Mysql databases to new location?

    Thanks,

    Kailash
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    This thread may help: http://forums.cpanel.net/showthread.php?t=71424

    That thread also links to another thread that may help.
     
  3. Marty

    Marty Well-Known Member

    Joined:
    Oct 10, 2001
    Messages:
    630
    Likes Received:
    1
    Trophy Points:
    18
    cd /var/lib

    service chkservd stop

    service mysql stop

    mv mysql /home

    ln -s /home/mysql mysql

    service mysql start

    service chkservd start

    That is the way I do it. Use at your own risk. I think I have ln -s command correct.
     
    jugo likes this.
  4. Kailash1

    Kailash1 Well-Known Member

    Joined:
    Nov 27, 2006
    Messages:
    252
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Twitter:
    Thanks David and Marty.

    And sorry for the duplicate post.

    Kailash
     
  5. Kailash1

    Kailash1 Well-Known Member

    Joined:
    Nov 27, 2006
    Messages:
    252
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Twitter:
    Will it create any problem taking cPnel backup (including MySQL databases) after changing the location of MySQL databases.

    Thanks,

    Kailash
     
  6. Marty

    Marty Well-Known Member

    Joined:
    Oct 10, 2001
    Messages:
    630
    Likes Received:
    1
    Trophy Points:
    18
    No, the backups will follow the symlink, so there is no problem at all.
     
  7. Kailash1

    Kailash1 Well-Known Member

    Joined:
    Nov 27, 2006
    Messages:
    252
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Twitter:
    Thanks Marty,

    Kailash
     
  8. jugo

    jugo Active Member

    Joined:
    Nov 23, 2005
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    6
    Worked for me....

    Thanks.:D
     
Loading...

Share This Page