Differences between revisions 1 and 2
Revision 1 as of 2009-07-10 14:08:46
Size: 1283
Editor: CarlNobile
Comment:
Revision 2 as of 2009-07-29 18:04:28
Size: 1283
Editor: CarlNobile
Comment:
Deletions are marked like this. Additions are marked like this.
Line 16: Line 16:
Change these lines to reflect the new path to your database. Now restart MySQL. Change these lines to reflect the new path to your database then restart MySQL.

MySQL Issues When Moving DB

On Dabian/Ubuntu systems a few things meed to be done when moving you DB to a location other than /var/lib/mysql.

Edit Apparmor Config

You need to edit the /etc/apparmor.d/usr.sbin.mysqld file.

Look for lines in this file like the ones below:

  /var/lib/mysql/ r,
  /var/lib/mysql/** rwk,

Change these lines to reflect the new path to your database then restart MySQL.

sudo /etc/init.d/mysql restart

You may have to kill processes before you can start it again.

Add/Change Permissions

The second issues you may run into is an error about permissions:

/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'

Look in the /etc/mysql/debian.cnf for the debian-sys-maint password then login to mysql and run the command below changing <password> to the one you found in /etc/mysql/debian.cnf.

$ mysql -uroot -p

GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY '<password>' WITH GRANT OPTION;

At this point you may have to kill mysql one more time, but subsequent stop/restart commands should work fine.

MovingMySQLDB (last edited 2012-09-25 14:49:20 by CarlNobile)