1 message in com.mysql.lists.mysqlHow to change database directory?
FromSent OnAttachments
Philip Mak22 Apr 2001 00:07 
Subject:How to change database directory?
From:Philip Mak (pm@aaanime.net)
Date:04/22/2001 12:07:03 AM
List:com.mysql.lists.mysql

Right now, my MySQL databases are inside /var/lib/mysql.

I need to move them into /home, because there is not enough room in the /var partition for the databases to grow much more.

This is a production server. How can I safely move the MySQL databases into /home, with minimal downtime and no data corruption?

I'm guessing that I should:

1. Change mysqld configuration file to use /home/mysql instead 2. /etc/rc.d/init.d/mysql stop # stop mysqld 3. Keep checking ps -A | grep mysql until mysqld is stopped 4. mv /var/lib/mysql /home/mysql 5. /etc/rc.d/init.d/mysql start # start mysqld

Is this correct? And how would I do step #1?

Thanks,