总之,对于我在本地主机上的一个小应用程序,使用XAMPP在Win10下安装的MySQL,我试图捕获所有查询。下面的SQL工作了一小段时间,但不再这样做了,尽管它确实报告了开销,显示在sql下面。
我尝试过停止和重启MySQL,但都无济于事。
任何帮助都是非常感谢的。
SET GLOBAL slow_query_log_file = 'C:/xampp/mysql/localhost-slow.log';
SET SESSION long_query_time = 0;
SET GLOBAL slow_query_log = 'ON';日志文件内容:
Time Id Command Argument
# Time: 170813 16:56:49
# User@Host: root[root] @ localhost [127.0.0.1]
# Thread_id: 9521 Schema: QC_hit: No
# Query_time: 0.000251 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0
# Rows_affected: 0
SET timestamp=1502657809;
SET GLOBAL slow_query_log = 'ON';
# User@Host: root[root] @ localhost [127.0.0.1]
# Thread_id: 9521 Schema: QC_hit: No
# Query_time: 0.000461 Lock_time: 0.000035 Rows_sent: 1 Rows_examined: 1
# Rows_affected: 0
SET timestamp=1502657809;
SHOW SESSION VARIABLES LIKE 'FOREIGN_KEY_CHECKS';
# User@Host: root[root] @ localhost [127.0.0.1]
# Thread_id: 9521 Schema: QC_hit: No
# Query_time: 0.000002 Lock_time: 0.000000 Rows_sent: 1 Rows_examined: 0
# Rows_affected: 0
SET timestamp=1502657809;
# administrator command: Quit;发布于 2017-08-14 05:30:35
使用这个
mysqld
general_log =打开
general_log_file=/usr/log/general.log
在my.cnf / my.ini文件中
xampp: c:\xampp\mysql\bin\my.ini。
https://stackoverflow.com/questions/45665045
复制相似问题