centos 7: 迁移MySQL目录
Steps:
1. systemctl stop mariadb
2. mkdir data destination folder, ex: /home/mysql
3. cp -R /var/lib/mysql/* /home/mysql
4. edit /etc/my.cnf
datadir = /home/mysql
socket = /home/mysql/mysql.sock
5. chcon -Rt mysqld_db_t /home/mysql/
chcon -Ru system_u /home/mysql/
chown -R mysql:mysql /home/mysql/
Done.