【发布时间】:2016-07-21 05:34:39
【问题描述】:
下午好,
我们正在尝试访问位于“/var/log/mysql/localhost-slow.log”的慢查询日志文件,但看起来该文件为空。 “my.cnf”文件显示“!includedir /etc/my.cnf.d”,在该目录中我们有以下文件:
mysql-clients.cnf;
server.cnf;
tokudb.cnf;
查看“server.cnf”文件,它似乎已正确设置为写入慢查询日志:
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
slow-query-log = 1
slow-query-log-file = /var/log/mysql/localhost-slow.log
long_query_time = 1
log-queries-not-using-indexes
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are only read by MariaDB servers, not by MySQL.
# If you use the same .cnf file for MySQL and MariaDB,
# you can put MariaDB-only options here
[mariadb]
[mariadb-5.5]
我们已尝试设置 GLOBAL general_log = 'ON';但这没有帮助。知道可能是什么问题吗?
【问题讨论】: