1,
Https://github.com/Meituan-Dianping/SQLAdvisor/blob/master/doc/QUICK_START.md
http://www.ttlsa.com/mysql/meituan-sql-optimization-tool-sqladvisor/
Enter the command in the MySQL client:
Show variables like '%quer% ';
The options for the red box callout are:
-slow_query_log whether to log slow queries. Use the value of the Long_query_time variable to determine "slow query".
-slow_query_log_file Slow log file path
-long_query_time Slow Log execution time (seconds), the log is not logged until the set time is exceeded
2, Linux:
Added under the [mysqld] option of the/ETC/MY.CNF configuration file:
Slow_query_log=true
Slow_query_log_file=/usr/local/mysql/slow_query_log.txt
Long_query_time=3
Windows:
Added under the [mysqld] option of the My.ini configuration file:
Slow_query_log=true
Slow_query_log_file=c:/slow_query_log.txt
Long_query_time=3
3, after restarting MySQL, you can find that the slow query log has been turned on
Enter the command check in the MySQL client:
Show variables like '%quer% ';
How to turn on MySQL slow query log