MySQL Slow query configuration
MySQL logs all SQL statements that execute more than the set time threshold of the Long_query_time parameter, and the slow query log is the SQL log
Turn on Slow Query method
Method One,
In the MySQL config file (under Windows My.ini,linux my.cnf)
Add the following mysqld in the
Log_slow_queries="D:\wamp\bin\mysql\mysql5. 5.28\mylog\slowquery. Log "Long_query_time = 1 Log -queries-not-using-indexes (if the queried SQL does not use an index (regardless of whether the table has an index), it is also logged)
Method Two,
Show variables like "slow%";
Set global Slow_query=1;
You can also add the item configuration under Configuration file mysqld
Global Slow_query=1long_query_time=1slow_query_log_file =/tmp/slow. Log
Method One is configured, the method two is invalid, the method is a priority!
MySQL Slow query