1

I have a MySQL 5.5.41 server running on Ubuntu 14.04 that already contains several databases of data, and I would like to enable binary logging. I want the binary logs to be placed in their own directory, /var/log/mysqld, which did not exist prior. I created the directory, set its permissions to mysql:root 0755, and added a file to /etc/mysql/conf.d with the following contents:

[mysqld]
log_bin=/var/log/mysqld/mysql-bin.log
expire_logs_days=1
binlog_format=ROW

Unfortunately, running service mysql restart then failed to bring MySQL back up, and the MySQL error logs contain the message:

/usr/sbin/mysqld: File '/var/log/mysqld/mysql-bin.index' not found (Errcode: 2)

What do I have to do to get this to work?

1 Answer 1

2

It turns out the problem was caused by apparmor. I had to add the following two lines to /etc/apparmor.d/usr.sbin.mysqld:

  /var/log/mysqld/ r,
  /var/log/mysqld/* rw,

and then run apparmor_parser -r /etc/apparmor.d/usr.sbin.mysqld before restarting MySQL.

1
  • Problem solved with the help of this SO question
    – jwodder
    Apr 13, 2015 at 15:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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