database:mysql:move_data_folder

Relocate MySql data folder

rsync -avzh /var/lib/mysql /data
mv /var/lib/mysql /var/lib/mysql.bak
mkdir /var/lib/mysql
mount -B /data/mysql /var/lib/mysql

Additionally

/etc/fstab
/data/mysql     /var/lib/mysql  auto    defaults,nofail,nobootwait,bind 0       2
Enter your comment:
B C V A V
 
  • database/mysql/move_data_folder.txt
  • Last modified: 2020-02-21 10:34
  • (external edit)