Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an EC2 instance set up and I'm trying to move the MySQL data directory to mounted storage.

The default data directory is:


I've copied that directory entirely to


Then I changed the path in my.cnf to the following:


and renamed the old directory to be sure I'm using the new one.

I've given proper permissions to MySQL on the new directory - but I don't even think MySQL is trying to get there. When I try to restart mysql I get errors about the previous data directory:

sudo /opt/bitnami/ start mysql
111122 18:50:50 mysqld_safe Logging to '/opt/bitnami/mysql/data/mysqld.log'.
touch: cannot touch `/opt/bitnami/mysql/data/mysqld.log': No such file or directory
chown: cannot access `/opt/bitnami/mysql/data/mysqld.log': No such file or directory
111122 18:50:50 mysqld_safe Starting mysqld.bin daemon with databases from /opt/bitnami/mysql/data
/opt/bitnami/mysql/bin/mysqld_safe: 739: cannot create /opt/bitnami/mysql/data/mysqld.log: Directory nonexistent
eval: 1: cannot create /opt/bitnami/mysql/data/mysqld.log: Directory nonexistent
111122 18:50:50 mysqld_safe mysqld from pid file /opt/bitnami/mysql/data/ ended
/opt/bitnami/mysql/bin/mysqld_safe: 783: cannot create /opt/bitnami/mysql/data/mysqld.log: Directory nonexistent

Am I missing a configuration step somewhere? I've seen others with issues solve it by adjusting apparmor, but I don't even have the file "/etc/apparmor.d/usr.sbin.mysqld" that they're supposed to be changing. Plus, my problem doesn't seem to be that mysql can't access the new directory - it's that it's still using the old one.

share|improve this question
up vote 1 down vote accepted

Turns out Amazon's control script "/opt/bitnami/" is executing a mysql config script at /opt/bitnami/mysql/scripts/

Annoyingly, this script overrides a few key settings from the my.cnf file. Updating them there fixes the issue.

share|improve this answer

You have to configure mysql to use the new log directory, please edit /etc/mysql/my.cnf (in this case I'm using Debian) and update

general_log_file = /mnt/data/log

Good luck.

share|improve this answer… That looks like the name of the log file to me, not the path? My my.cnf does not have a setting for general_log_file so I would assume it should be attempting to write to the data directory. – Matt Brunmeier Nov 22 '11 at 20:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.