PDA

View Full Version : [ubuntu] Unable to change the MySQL datadir



rahbz
June 13th, 2013, 07:41 AM
As given in the below forum thread, I followed all the steps
http://lists.mysql.com/mysql/220448 (http://lists.mysql.com/mysql/220448)
But after changing the datadir option in my.conf, MySQL will not get started showing this
ganit@garo:~$ sudo service mysql start
start: Job failed to start

Even if I just change the name of /var/lib/mysql to /var/lib/mysql_old
and change name accordingly in my.conf, service doesnt get started.

Thanks in advance,

Cheesemill
June 13th, 2013, 08:30 AM
On Ubuntu you also need to edit the MySQL AppArmor profile to give the MySQL daemon access to the new location.
I'm not on a Ubuntu machine with MySQL installed at the moment but I believe the file you need to edit is /etc/apparmor.d/usr.sbin.mysqld.

rahbz
June 13th, 2013, 10:34 AM
Cheesemill, thanks for the update
http://stackoverflow.com/questions/1795176/how-to-change-mysql-data-directory. I found this thread and eventually I wound up fixing the issue.

Thank you,