[摘要]+---------------------+---------------------------------+ 4 rows in set (0.00 sec) mysql> set ...
+---------------------+---------------------------------+
4 rows in set (0.00 sec)
mysql> set slow_query_log='ON';
<SPAN style="COLOR: #ff00ff"> //加上global,不然会报错的</SPAN>
ERROR 1229 (HY000): Variable 'slow_query_log' is a GLOBAL variable and should be set with SET GLOBAL
mysql> set global slow_query_log='ON';
<SPAN style="COLOR: #ff00ff">//这个参数设置为ON,表示启用慢查询,可以捕获执行时间超过一定数值的SQL语句。</SPAN>
Query OK, 0 rows affected (0.28 sec)
mysql> show variables like "%slow%";
<SPAN style="COLOR: #ff00ff">//查看是否已经开启 </SPAN>
+---------------------+---------------------------------+
关键词:Mysql慢查询设置的代码总结