Today the hands are cheap, see the MySQL log under/var/log/mysql. Always feel awkward, so I want to change the location of the log,
I development environment vagrant + ubuntu12.04, in/etc/mysql/mysql modified the location of the General_log, placed under/data/logs/mysql
Then restart Services, service MySQL restart
View error log Discovery says
/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 permission issue, and finally gave 777 or uncertain, with the help of the almighty Google found the answer
As usual, the solution is simple and 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 is estimated that many people will ask what AppArmor is doing, and I do not know it at the moment, and later I read an article
Original address: "Change MySQL log location bug" Could not use Mysql.log for logging (Error 13)
"Change MySQL log location bug" Could not use Mysql.log for logging (Error 13)