首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >慢查询日志为空

慢查询日志为空
EN

Stack Overflow用户
提问于 2016-04-01 20:02:29
回答 1查看 1K关注 0票数 1

下午好,

我们试图访问位于"/var/ log /mysql/localhost-slow.log“的慢查询日志文件,但该文件看起来是空的。"my.cnf“文件显示为"!includedir /etc/my.cnf.d",在该目录中有以下文件:

代码语言:javascript
复制
mysql-clients.cnf;
server.cnf;
tokudb.cnf;

查看"server.cnf“文件,它似乎被正确地设置为写入缓慢的查询日志:

代码语言:javascript
复制
#
# 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]

我们已经尝试设置全局general_log = 'ON';但是没有帮助。你知道问题出在哪里吗?

EN

回答 1

Stack Overflow用户

发布于 2016-04-04 04:40:42

验证它是否确实在读取该文件:

代码语言:javascript
复制
mysqld --verbose --help | head -33

你可能会看到

代码语言:javascript
复制
Default options are read from the following files in the given order:

后跟文件路径列表。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36355857

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档