I am trying to move the data directory of my MySQL database to a second disk array that I have as a mount point /array2/
.
The problem I am having is I have tried everything and after I modify the location of datadir in my.cnf mysql will not start up again.
All I get is:
start: Job failed to start
Best Answer
Forgot about app armour.
For anyone that is interested I did the following to move the folder.
Stop the mysql server:
Create the new directory:
Copy over ONLY the database folders:
Backup the
my.cnf
file:Edit the
my.cnf
file:Change all mentions of the old datadir and socket to your new location
Mine became:
Update the directory permissions:
Rename the old directory:
Create a symlink, just in case:
Let AppArmor know about the new datadir:
Reload the apparmor profiles
Then start mysql: