mysql> set global long_query_time=1000;
mysql> show variables like 'long_query_time';
+-----------------+------------+
| Variable_name | Value |
+-----------------+------------+
| long_query_time | 100.000000 |
+-----------------+------------+
1 row in set (0.01 sec)
#####################################################
mysql> set global long_query_time=500;
mysql> show variables like 'long_query_time';
+-----------------+------------+
| Variable_name | Value |
+-----------------+------------+
| long_query_time | 100.000000 |
+-----------------+------------+
1 row in set (0.01 sec)
###############################################
=============默认是10==============
mysql> show variables like 'long_query_time';
+-----------------+-----------+
| Variable_name | Value |
+-----------------+-----------+
| long_query_time | 10.000000 |
艾玛,怎么单位mysql 8.0.17?????
官方:
https://dev.mysql.com/doc/refman/8.0/en/slow-query-log.html
Slow Query Log Parameters
The minimum and default values of long_query_time are 0 and 10, respectively. The value can be specified to a resolution of microseconds.
慢速查询日志参数
long_query_time的最小值和默认值分别为0和10。该值可以指定为微秒分辨率。
那就是s唠!
本文详细介绍了如何在MySQL中设置慢查询阈值long_query_time,包括其默认值、单位及微秒级精度调整方法。通过实例展示了不同设置下long_query_time的显示效果。
775

被折叠的 条评论
为什么被折叠?



