您现在的位置: 首页 > 数据库 > MySQL教程 > 正文

ERROR 29 (HY000): File '/var/log/mysql-slow.log' not found (Errcode: 13 - Permission denied)

作者:admin来源:网络浏览:时间:2017-12-09 17:14:40我要评论
分享到
开启慢查询日志时会出现(Errcode: 13 - Permission denied)文件找不到的错误,但文件明明是存在的并且有读写的权限。

mysql> set global slow_query_log_file="/var/log/mysql-slow.log";
mysql> set global slow_query_log=on;                                        

ERROR 29 (HY000): File '/var/log/mysql-slow.log' not found (Errcode: 13 - Permission denied)

后来将文件路径改在了/var/log/mysql/slow_query.log下,设置权限后就成功了

重启mysql 查看 

mysql> show variables like 'slow_query%';
+---------------------+-------------------------------+
| Variable_name       | Value                         |
+---------------------+-------------------------------+
| slow_query_log      | ON                            |
| slow_query_log_file | /var/log/mysql/slow-query.log |
+---------------------+-------------------------------+
2 rows in set (0.01 sec)
相关热词搜索: