"Change MySQL log location bug" Could not use Mysql.log for logging (Error 13)

Source: Internet
Author: User

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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.