mysql Slow query log _1--How to turn on slow query log
Open MySQL slow query under Windows
MySQL configuration file in Windows system is generally my.ini find [mysqld] under the Add
Log-slow-queries=c:/program Files/mysql/mysql Server 5.1/datafiles/slowquery.log
long_query_time=2
Log-slow-admin-statements
Log-queries-not-using-indexes
MySQL slow query enabled under Linux
MySQL configuration file in Linux system is generally my.cnf find [mysqld] under the Add
Log-slow-queries=/usr/loca/mysql/datafiles/slowquery.log
long_query_time=2
Log-slow-admin-statements
Log-queries-not-using-indexes
Attention
Log-slow-queries =c:/program files/mysql/mysql Server 5.1/datafiles/ Slowquery.log for slow query log storage location, generally this directory to have MySQL running account of the writable permissions, 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;
Log-queries-not-using-indexes is also a new option for 5.1, which can be logged to the slow query log without using the index SQL statement
Log-slow-admin-statements This command option can write optimize table, ANALYZE table, and ALTER TABLE for administrative operations such as slow query log.
MySQL notes--turn on MySQL slow query