查询慢查询是否开始默认为off
show variables like '%slow_query%'
设置为1为on
set GLOBAL slow_query_log=1
查询慢查询时间
show variables like '%query_time%'
设置为2秒
set global long_query_time=2
![](https://img.haomeiwen.com/i12653063/89786cbef6038817.png)
![](https://img.haomeiwen.com/i12653063/0cd8edeaea4238b5.png)
![](https://img.haomeiwen.com/i12653063/ce77a13197197723.png)
查询慢查询是否开始默认为off
show variables like '%slow_query%'
设置为1为on
set GLOBAL slow_query_log=1
查询慢查询时间
show variables like '%query_time%'
设置为2秒
set global long_query_time=2
本文标题:MySQL的慢查询
本文链接:https://www.haomeiwen.com/subject/ikcguftx.html
网友评论