gpt4 book ai didi

MySQL 不将慢速查询记录到表中

转载 作者:行者123 更新时间:2023-11-29 01:59:12 26 4
gpt4 key购买 nike

我希望 MySQL 将所有查询视为慢查询并将它们记录到表中。

MySQL 版本为 5.1.69。我做了以下事情:

set global log_output = "TABLE";
set global log_slow_queries = 1;
set global long_query_time = 0;

但是,尽管查询已执行,表mysql.slow_log 是空的。为什么? general_log 也已启用,mysql.general_log 包含所有查询。

最佳答案

Did you restart the server after updating the `my.cnf` file?

Please issue:

SELECT @@global.general_log;
SELECT @@global.general_log_file;
SELECT @@global.log_output;

These are the de-facto variables as the server sees them.
You may change tgem dynamically as follows:

SET GLOBAL general_log:=1;
SET GLOBAL log_output := 'FILE';

Also, as last resort, try:

FLUSH LOGS;

to close+reopen log file descriptor.

关于MySQL 不将慢速查询记录到表中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19571287/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com