MySQL moving ibdata & ib_logfile

Posted by XoR on Server Fault See other posts from Server Fault or by XoR
Published on 2012-04-05T09:32:28Z Indexed on 2012/04/05 11:32 UTC
Read the original article Hit count: 394

Filed under:
|
|
|
|

I'm trying to move ibdata & ib_logfile on ssd drive. I tried this way, but it don't work:

service mysql stop
cd /var/lib/
cp -ra mysql mysql_backup
cp -a mysql/ibdata1 mysql/ib_logfile* /ssd_drive/mysql

my.cnf looks like this (relevant parts):

innodb_log_group_home_dir=/ssd_drive/mysql
innodb_data_home_dir=/ssd_drive/mysql

After all changes I get following errors:

InnoDB: Unable to lock /ssd_drive/mysql/ibdata1, error: 13
InnoDB: Check that you do not already have another mysqld process

Do I need to remove some lock files, or there is something else that I forgot...

Also I setup mysql apparmor so it can rw on this directory, and rebooted afterward:

/usr/sbin/mysqld {
.................
 /ssd_drive/mysql/* rw,
.................
}

© Server Fault or respective owner

Related posts about ubuntu

Related posts about mysql