How to use Mysql slow check in.

In MySQL you can use to find out the slow running slow SQL statements.

1. Review the slow check in the MySQL command line: show variables like '% query%'

FIG "ON" indicates the slow investigation has been opened, is "OFF" off.

 

2. Open slow search set global slow_query_log = ON 

3. Slow set time limit check, if the time exceeds the set will be recorded into the search log slow.

 set long_query_time=“秒”

4. Set the storage path log file path global slow_query_log_file = "Path"

Global log_ouput 5. format output file = file

 

Can slow query permanently open, the input to the code modification mysql configuration file following the "[mysql]"

= the ON slow_query_log   
slow_query_log_file = "log file storage path"
long_query_time = "slow search restrictions seconds"

 

Guess you like

Origin www.cnblogs.com/glwuzhang/p/11537121.html