THE SETUP
I'm running Linux CentOS on an Amazon EC2 instance.
The MySQL data files are on an EBS Drive mounted at /data/ ( symlink – /var/lib/mysql >> /data/mysql ).
Everything works fine in this setup.
THE PROBLEM
I'm trying to move everything from this EBS drive to a new drive. I umounted the /data/ drive, and mounted it at /data2/. Then I mounted the new drive at /data/ and copied everything over to it from /data2/. Everything on the system works great, except MySQL. Every time I try to start the MySQL daemon ( /etc/init.d/mysqld start ) I get a MySQL Daemon failed to start
error.
Best Answer
The problem was in the user permissions.
I did a
sudo chown -R mysql:mysql /data/mysql
and it fixed the problem. It was important that I included the recursive -R in there because it looked like all the files had the correct user 'mysql' when I did als -l
. They apparently did not, however.The MySQL daemon now starts fine when I run
sudo /etc/init.d/mysqld start
.