Go to MySQL database and use
Show variables like ' Slow_query_log ';
See if the slow query log is turned on
Value is off, the slow query log is not turned on, and before we turn on the slow query log, we want to determine whether the query that does not use the index is turned on in MySQL, using
like ' %log% ';
To view
The default is off, first we want to turn on this configuration, use to open.
set global log_queries_not_using_indexes=on;
Next use, see how long queries will be logged in MySQL, and if 0.00, all queries will be logged.
like ' Long_query_time ';
Next really turn on slow query log
set global slow_query_log=on;
To find out which folder the slow log file is placed under
like ' slow% ';
Query results, the slow log file is below the folder
The next section shares how to parse the slow query log ...
MySQL database optimization open slow query log