mysql slow log



/etc/my.cnf
[mysqld]
slow_query_log = ON
slow_query_log_file = /usr/local/mysql/data/slow.log
long_query_time = 2


SHOW VARIABLES LIKE '%query%';

Variable_name               |Value                         |
----------------------------|------------------------------|
binlog_rows_query_log_events|OFF                           |
ft_query_expansion_limit    |20                            |
have_query_cache            |NO                            |
long_query_time             |2.000000                      |
query_alloc_block_size      |8192                          |
query_prealloc_size         |8192                          |
slow_query_log              |ON                            |
slow_query_log_file         |/usr/local/mysql/data/slow.log|

posted @ 2022-11-25 17:30  tonggc1668  阅读(22)  评论(0编辑  收藏  举报