Slow sql log opening and file viewing in Mysql

.查看日志是否打开:show variables like 'slow_query_log';

没打开需设置打开:set global slow_query_log = on;
.查询慢SQL的时间: show global  variables like 'long_query_time';

默认是10s,可以自定义设置时间(s)set global long_query_time =2;
.查看日志文件存放地址: show variables like 'slow_query_log_file';

Guess you like

Origin blog.csdn.net/m0_49412847/article/details/122835115