1. mysql 5.5 可能和别的版本的在my.ini配置中的关键字可能不同
2.如何发现关键字
mysql> show variables like '%log%';
结果:
| log_slow_queries ON
| slow_query_log ON
| slow_query_log_file C:\ProgramData\MySQL\MySQL Server 5.5\Data\Macrotea-PC-slow.log
3.修改 my.ini
[mysqld]
log_slow_queries=ON
long_query_time=2
slow_query_log=ON
log_queries_not_using_indexes=ON
slow_query_log_file=C:/ProgramData/MySQL/MySQL Server 5.5/Data/log/slow.log
# The TCP/IP Port the MySQL Server will listen on
port=3306
原文:http://macrotea.iteye.com/blog/1722031