Home >Database >Mysql Tutorial >How to enable mysql slow query log configuration

How to enable mysql slow query log configuration

WJ
WJforward
2020-05-30 10:18:282469browse

How to enable mysql slow query log configuration

How to enable mysql slow query log configuration

By default, the value of slow_query_log is OFF, indicating slow query log It is disabled and can be turned on by setting the value of slow_query_log

Open mysql and check whether it is turned on first. As shown below, the status is turned off

show variables like '%slow_query_log%';

How to enable mysql slow query log configuration

##Open

set global slow_query_log=1;

After querying once, the on status in the figure below indicates that it is open. show_query_log_file is the file location where slow statements are recorded.

show variables like '%slow_query_log%';

How to enable mysql slow query log configuration

The above is all about how to enable mysql slow query log configuration.

Related references:

php中文网

The above is the detailed content of How to enable mysql slow query log configuration. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:51dev.com. If there is any infringement, please contact admin@php.cn delete