Open MySQL slow query under Windows
MySQL configuration file in Windows system is generally my.ini find [mysqld] under the Add
Log-slow-queries = F:\MySQL\log\mysqlslowquery.log
Long_query_time = 2
MySQL slow query enabled under Linux
MySQL configuration file in Windows system is generally my.cnf find [mysqld] under the Add
Log-slow-queries=/data/mysqldata/slowquery.log
long_query_time=2
Attention
Log-slow-queries = F:\MySQL\log\mysqlslowquery.log for slow query log storage location, generally this directory to have MySQL running account of the writable permission, generally set this directory as MySQL data storage directory;
Long_query_time=2 2 indicates that the query is more than two seconds before logging;
Add the log-queries-not-using-indexes parameter in my.cnf or My.ini to indicate a query that does not use an index under the record. Like what:
Log-slow-queries=/data/mysqldata/slowquery.log
long_query_time=2
Log-queries-not-using-indexes
Mysqldumpslow command
Official command for easy querying of slow SQL
Reference:
Http://kimi.it/326.html
http://kimi.it/category/mysql/
MySQL Slow query