Ok, I'm on a fresh server install of 8.04, with the mysql installed via the menu during the install.
Here are the steps I used:
1. stopped mysql.
2. I copied the /var/lib/mysql to /srv/mysql
Code:
sudo cp /var/lib/mysql /srv/mysql -p -r
to preserve all directory and file attributes.
3. Edited the /etc/mysql/my.cnf
Code:
datadir = /var/lib/mysql
was replaced with
Code:
datadir = /srv/mysql
4. Edited the /etc/apparmor.d/usr.sbin.mysqld, replaced
Code:
/var/lib/mysql/ r,
/var/lib/mysql/** rwk,
with
Code:
/srv/mysql/ r,
/srv/mysql/** rwk,
5. restarted apparmor.d
6. restarted mysql.d
7. got a [fail!] when trying to restart mysql.d, here is the error i got..
Code:
May 22 21:03:12 larouchenet mysqld_safe[10288]: started
May 22 21:03:12 larouchenet mysqld[10291]: 080522 21:03:12 [Warning] Can't create test file /srv/mysql/larouchenet.lower-test
May 22 21:03:12 larouchenet mysqld[10291]: 080522 21:03:12 [Warning] Can't create test file /srv/mysql/larouchenet.lower-test
May 22 21:03:12 larouchenet mysqld[10291]: 080522 21:03:12 InnoDB: Operating system error number 13 in a file operation.
May 22 21:03:12 larouchenet mysqld[10291]: InnoDB: The error means mysqld does not have the access rights to
May 22 21:03:12 larouchenet mysqld[10291]: InnoDB: the directory.
May 22 21:03:12 larouchenet mysqld[10291]: InnoDB: File name ./ibdata1
May 22 21:03:12 larouchenet mysqld[10291]: InnoDB: File operation call: 'open'.
May 22 21:03:12 larouchenet mysqld[10291]: InnoDB: Cannot continue operation.
May 22 21:03:12 larouchenet mysqld_safe[10298]: ended
Am I missing a step? As far as I can see, all of the permissions are exactly the same as when the directory was in /var/lib
Please, can anyone help?
-Adam S.
Bookmarks