1. 停止mysql服务

service mysql stop

2. 迁移数据文件(假设迁移目标是/srv/dev-disk-by-id-ata-ST9500325AS_S2WDDPAR-part1/mysql_data)

cd /var/lib/
cp -a mysql /srv/dev-disk-by-id-ata-ST9500325AS_S2WDDPAR-part1/mysql_data

4、下面需要建立一个链接:

ln -s /srv/dev-disk-by-id-ata-ST9500325AS_S2WDDPAR-part1/mysql_data/mysql    /var/lib/mysql

5.启动mysql服务

service mysql start

 

共有 0 条评论