【发布时间】:2016-01-31 18:10:41
【问题描述】:
我在 .my.cnf 中有以下内容
# LOGGING #
slow_query_log = ON
slow_query_log_file = /var/log/mariadb/slow_query.log
log-queries-not-using-indexes = 1
当我运行 tune-primer.sh 时,我得到了这个:
SLOW QUERIES
The slow query log is NOT enabled.
Current long_query_time = 10.000000 sec.
You have 0 out of 36 that take longer than 10.000000 sec. to complete
Your long_query_time seems to be fine
谁能解释一下这怎么可能?
【问题讨论】:
-
将 long_query_time 降低到 1(或其他一些小值)。
-
这些设置是否在
.my.cnf的[mysqld]部分中?.my.cnf真的被读取了吗? (在其中更改long_query_time显然会提供这样的线索。) -
+-----------------+----------+ |变量名 |价值 | +-----------------+----------+ | long_query_time | 1.000000 | +-----------------+----------+
-
是的,设置在 [mysqld] 中,我用什么命令来查看当前正在使用的配置?
-
SHOW GLOBAL VARIABLES;(来自 mysql 命令行工具;UI 有一些地方可以执行任意命令。)看起来你这样做了。
标签: mysql mysql-slow-query-log