mysql 5.0 与 5.1 记录慢查询日志的区别

在mysql5.1之前的版本中,只需要
log_slow_queries=filename  // 注意:这里必须是绝对路径
slow-query-log=1

就可以开启Slow Query log(慢查询日志)了。
但这样在mysql 5.1中并不管用。

日志中会有如下的错误:
[Warning] '--log_slow_queries' is deprecated and will be removed in a future release. Please use ''--slow_query_log'/'--slow_query_log_file'' instead.

修改如下:
log_output=FILE # also can be FILE,TABLE or TABLE or NONE
slow-query-log=1
slow_query_log_file=filename

添加新评论 »