Turning logging off for the whole duration of the MySQL server process.
File '/var/log/slow_query.log' not found (Errcode: 13 - Permission denied)[ERROR] Could not open /var/log/slow_query.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.File '/var/log/query.log' not found (Errcode: 13 - Permission denied)
在配置慢查询的时候,指定的文件一直没出现,查看了mysql日志发现这个问题;经过一阵网上搜索,没有收获;认真看了错误信息,原来是文件权限不够。解决:1、使用root用户登录,在指定的文件夹下新建文件,如:cd /var/logtouch slow_query.logtouch query.log2、对新建的文件进行更改chown mysql slow_query.logchown mysql query.log3、重启mysql:service mysql restart登录mysql进行测试select sleep(6);现在指定文件中select sleep(6);# Time: 160517 16:52:15# User@Host: root[root] @ localhost [127.0.0.1] Id: 5# Query_time: 3.313177 Lock_time: 0.000292 Rows_sent: 843 Rows_examined: 1015609成功了!!!