我按照这里的说明操作: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
不指示任何日志文件路径,我在我的服务器上看不到任何慢查询日志文件...
编辑
看起来我正在使用服务器版本5.0.77,所以我需要这样做:
SET GLOBAL log_slow_queries = 1;
但我得到:ERROR 1238(HY000):变量'log_slow_queries'是一个只读变量
我假设我需要重新启动服务器并在我的配置中设置log_slow_queries?
mysql ×1