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唠!