我按照这里的说明: http://crazytoon.com/2007/07/23/mysql-changing-runtime-variables-with-out-restarting-mysql-server/,但这似乎只设置了阈值。
我是否需要执行其他操作,比如设置文件路径?
根据 MySQL 的文档
If no file_name value is given for --log-slow-queries, the default name is host_name-slow.log. The server creates the file in the data directory unless an absolute path name is given to specify a different directory.
跑步
SHOW VARIABLES
doesn't indicate any log file path and I don't see any slow query log file on my server...
EDIT
Looks like I'm using server version 5.0.77, so I needed to do:
SET GLOBAL log_slow_queries = 1;
但是我得到: ERROR 1238(HY000) : 变量‘ log _ slow _ query’是一个只读变量
我假设我需要重新启动服务器并在我的配置中设置 log _ slow _ query?