|
|
配置文件必须是数据库形式的存储* o% B" D- I3 y, ^
/ J1 z9 R% {4 x1 W
- #配置慢查询
7 T; y3 ~5 \+ |% d. i - slow_query_log = ON
1 q; J3 Q E/ o - log_output=table+ f( {2 l( ?" F" v9 z
- slow_query_log_file = /home/mysqlData/slow_query.log
+ ]3 W, y. b( A6 v - long_query_time = 0.5
' x' F' V, x0 c) P) |# h - log_queries_not_using_indexes=ON
复制代码 使用以下命令& P& \0 R; l) _! s
5 O' }0 }/ ]$ {5 y9 }- SET GLOBAL slow_query_log = 'OFF';0 l+ f/ Z! j( L! ^( w. @
- ALTER TABLE mysql.slow_log RENAME mysql.slow_log_drop; b2 }5 c P6 w" U9 ^
- CREATE TABLE mysql.slow_log LIKE mysql.slow_log_drop;' b: b8 O( f) B$ c) z" W
- SET GLOBAL slow_query_log = 'ON';8 c7 ^( s' ?7 N) `4 U% ]/ d+ C# j
- DROP TABLE mysql.slow_log_drop;
复制代码 |
|