Bla*_*nka 4 mysql configuration logging query percona
我们有一个 MySQL 5.1.52 Percona Server 11.6 实例,它突然开始将每个查询记录到慢查询日志中。该long_query_time配置设置为1,然而,突然我们看到每一个查询(例如刚才看到一个拿了0.000563s!)。结果,我们的日志文件以疯狂的速度增长。我们只需要截断一个 180G 的慢查询日志文件。
我尝试将 long_query_time 变量设置为一个非常大的数字,以查看它是否完全停止 ( 1000000),但结果相同。
show global variables like 'general_log%';
+------------------+--------------------------+
| Variable_name | Value |
+------------------+--------------------------+
| general_log | OFF |
| general_log_file | /usr2/mysql/data/db4.log |
+------------------+--------------------------+
2 rows in set (0.00 sec)
show global variables like 'slow_query_log%';
+---------------------------------------+-------------------------------+
| Variable_name | Value |
+---------------------------------------+-------------------------------+
| slow_query_log | ON |
| slow_query_log_file | /usr2/mysql/data/db4-slow.log |
| slow_query_log_microseconds_timestamp | OFF |
+---------------------------------------+-------------------------------+
3 rows in set (0.00 sec)
show global variables like 'long%';
+-----------------+----------+
| Variable_name | Value |
+-----------------+----------+
| long_query_time | 1.000000 |
+-----------------+----------+
1 row in set (0.00 sec)
Run Code Online (Sandbox Code Playgroud)
qua*_*nta 12
听起来像是log_queries_not_using_indexes启用了。
通过执行以下操作来检查它:
mysql> show global variables like 'log_queries%';
+-------------------------------+-------+
| Variable_name | Value |
+-------------------------------+-------+
| log_queries_not_using_indexes | ON |
+-------------------------------+-------+
Run Code Online (Sandbox Code Playgroud)
关闭它:
mysql> set global log_queries_not_using_indexes = 'off';
Query OK, 0 rows affected (0.00 sec)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6610 次 |
| 最近记录: |