Disk full, how to move mysql database files?

Posted by kopeklan on Server Fault See other posts from Server Fault or by kopeklan
Published on 2010-12-22T14:58:02Z Indexed on 2010/12/22 15:56 UTC
Read the original article Hit count: 238

Filed under:
|

my database files located in /var/lib/mysql which located in partition /dev/sda5

this partition is full (refer here for details)

so I'm going to move the location of database files from /var/lib/mysql to /home/lib/mysql

What is the right way to move this database files?

Im going to do this steps:

  1. Stop http server and PHP
  2. Change datadir=/var/lib/mysql to become datadir=/home/lib/mysql in /etc/my.cnf
  3. move all database files to the new location
  4. run killall -9 mysql, then /etc/init.d/mysqld start
  5. Start http server and PHP

Is this right? Correct me if I'm wrong

added:

currently, mysql won't stop. refer here: mysql wont stop, mysqld_safe appeared in top

© Server Fault or respective owner

Related posts about mysql

Related posts about database