Custom mysql log apparmor cause problems

Hand cheap today, see below mysql log in / var / log / mysql. Always feel awkward, so I wanted to change the location of the log,

I development environment vagrant + ubuntu12.04, modified general_log location / etc / mysql / mysql, the on / data / logs / mysql below

Then restart the service, service mysql restart

Viewing error logs found say 


/usr/sbin/mysqld: File '/data/logs/mysql/mysql.log' not found (Errcode: 13)
150830  0:02:44 [ERROR] Could not use /data/logs/mysql/mysql.log for logging (error 13). Turning logging off for the whole duration of the MySQL server process. To turn it on again: fix the cause, shutdown the MySQL server and restart it.


Guess is a permissions problem, finally gave 777 still working, found the answer with the help of the Almighty google

As usual, the solution was simple but not obvious: it needed to edit apparmor settings I just added to /etc/apparmor.d/usr.sbin.mysqld a new string with path to target directory: /home/developer/logs/* rw
It works!


Original Address: http://stackoverflow.com/questions/7660410/try-to-change-bin-log-directory-mysql-bin-index-not-found-errcode-13  


It estimated that many people will ask  apparmor is doing, check out the article: Ubuntu story behind apparmor


Original Address: AppArmor problem caused by custom mysql log
tags: mysql    Change-log    error13    AppArmor   

Intelligent Recommendation

Reproduced in: https: //my.oschina.net/54php/blog/600112

Guess you like

Origin blog.csdn.net/weixin_33924770/article/details/91518003