1.停止mysql
|
|
2.复制/var/lib/mysql目录到指定的路径
|
|
3.修改mysql配置文件my.cnf:
|
|
4.修改apparmor
|
|
将/var/lib/mysql路径替换为/data/mysql
|
|
5.重启
|
|
from:
1.How to change MySQL data directory?
2.Linux Ubuntu change datadir / database location dir in 5 minutes Move mysql database to other path