1./etc/init.d/mysql stop
2.cp –R /var/lib/mysql /home/mysql
3.chown -R mysql:mysql /home/mysql
4.vim /etc/mysql/my.cnf
datadir=/home/mysql
5.vim /etc/apparmor.d/usr.sbin.mysqld
/home/mysql/ r,
/home/mysql/** rwk,
6./etc/init.d/apparmor reload
7./etc/init.d/mysql start
修改完毕后可以通过show variables like 'datadir'查看是否修改成功。
阅读(3386) | 评论(0) | 转发(0) |