码迷,mamicode.com
首页 > 数据库 > 详细

【改变mysql 日志位置Bug】Could not use mysql.log for logging (error 13)

时间:2016-01-09 18:38:26      阅读:186      评论:0      收藏:0      [点我收藏+]

标签:

今天手贱,看到mysql 的日志在/var/log/mysql下面。总是觉得别扭,于是就想改变日志的位置,

本人开发环境 vagrant  + ubuntu12.04 ,在/etc/mysql/mysql中修改了general_log的位置,放在/data/logs/mysql下面

然后重启服务,service mysql restart

查看错误日志发现说 


/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.


猜测是权限问题,最后都给了777 也还是搞不定,在万能的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!


原文地址:http://stackoverflow.com/questions/7660410/try-to-change-bin-log-directory-mysql-bin-index-not-found-errcode-13  


估计很多人会问 apparmor 是干什么的,目前我也不知道了,稍后了解过后在写一篇文章


原文地址:【改变mysql 日志位置Bug】Could not use mysql.log for logging (error 13)

【改变mysql 日志位置Bug】Could not use mysql.log for logging (error 13)

标签:

原文地址:http://www.cnblogs.com/apanly/p/5116825.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!