service MysqL stop cd /var/lib/ cp -ra MysqL MysqL_backup cp -a MysqL/ibdata1 MysqL/ib_logfile* /ssd_drive/MysqL
my.cnf看起来像这样(相关部分):
innodb_log_group_home_dir=/ssd_drive/MysqL innodb_data_home_dir=/ssd_drive/MysqL
在所有更改后,我得到以下错误:
InnoDB: Unable to lock /ssd_drive/MysqL/ibdata1,error: 13 InnoDB: Check that you do not already have another MysqLd process
我也设置了MysqL apparmor,所以它可以在这个目录上运行,然后重新启动:
/usr/sbin/MysqLd { ................. /ssd_drive/MysqL/* rwk,................. }
更新:
我忘了把k选项,所以它可以锁定文件…