Results 1 to 8 of 8

Thread: Change mysql database directory

  1. #1
    Registered Member Kailash1's Avatar
    Join Date
    Nov 2006
    Posts
    233
    cPanel/WHM Access Level

    Root Administrator

    Default Change mysql database directory

    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
    Blog - Website/Server security

    Technical Support Forum

  2. #2
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,296
    cPanel/WHM Access Level

    Root Administrator

    Default

    Quote Originally Posted by Kailash1 View Post
    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
    This thread may help: http://forums.cpanel.net/showthread.php?t=71424

    That thread also links to another thread that may help.

  3. #3
    Registered Member
    Join Date
    Oct 2001
    Posts
    651

    Default

    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.
    Marty Hoskins
    TLC Web Enterprises

  4. #4
    Registered Member Kailash1's Avatar
    Join Date
    Nov 2006
    Posts
    233
    cPanel/WHM Access Level

    Root Administrator

    Default

    Thanks David and Marty.

    And sorry for the duplicate post.

    Kailash
    Blog - Website/Server security

    Technical Support Forum

  5. #5
    Registered Member Kailash1's Avatar
    Join Date
    Nov 2006
    Posts
    233
    cPanel/WHM Access Level

    Root Administrator

    Default

    Will it create any problem taking cPnel backup (including MySQL databases) after changing the location of MySQL databases.

    Thanks,

    Kailash
    Blog - Website/Server security

    Technical Support Forum

  6. #6
    Registered Member
    Join Date
    Oct 2001
    Posts
    651

    Default

    Quote Originally Posted by Kailash1 View Post
    Will it create any problem taking cPnel backup (including MySQL databases) after changing the location of MySQL databases.

    Thanks,

    Kailash
    No, the backups will follow the symlink, so there is no problem at all.
    Marty Hoskins
    TLC Web Enterprises

  7. #7
    Registered Member Kailash1's Avatar
    Join Date
    Nov 2006
    Posts
    233
    cPanel/WHM Access Level

    Root Administrator

    Default

    Thanks Marty,

    Kailash
    Blog - Website/Server security

    Technical Support Forum

  8. #8
    Registered Member jugo's Avatar
    Join Date
    Nov 2005
    Posts
    61

    Default

    Worked for me....

    Thanks.
    Game Servers, Website hosting and Dedicated Servers
    Freaks Network, Inc.

    Joomla Site Design and Modules
    http://www.mh2design.com

Similar Threads

  1. Change MySQL data directory
    By teksupportrena in forum cPanel & WHM Discussions
    Replies: 12
    Last Post: 01-18-2013, 05:52 AM
  2. How can I change my MySQL database collation via phpMyAdmin?
    By dreamzgaurav in forum Database Discussions
    Replies: 0
    Last Post: 01-07-2010, 04:56 AM
  3. Replies: 7
    Last Post: 12-28-2004, 05:13 PM
  4. MySQL database name change?
    By bjdea1 in forum cPanel & WHM Discussions
    Replies: 2
    Last Post: 07-27-2004, 09:18 AM
  5. Replies: 2
    Last Post: 05-07-2004, 08:59 PM
bargain