潸死蝔撘瑁敺, 嗡葉銝閬瑼X亦唳寞航摨怒MySQL 臭誑撠瑁 SQL 隤亙券函銝靘, 臭誑芣臬瑁Y SQL 隤亦銝靘, 璅撠 MySQL 隤亦 Debug 撠梯擛敺憭鈭
S! |# p: {& @1 m8 t K V3 ~* [. m; h, ^
閬蝝瑁Y SQL 隤, 臭誑靽格 my.cnf 摰, my.cnf 憭詨其誑銝雿蝵:& T Q" A6 h6 N" t& a; ]! ^
/ R6 s+ S0 S. e ^+ a5 T/etc/my.cnf
9 I- r7 W5 W6 K$ o4 q6 ]/etc/mysql/my.cnf
]/ d9 O3 Z. }, Y" B
/ F6 \4 L: f/ K4 a% u my.cnf, [mysqld] 畾菔賢乩誑銝撟曇:! v9 `+ s4 c; R# d+ a1 n. @! ^
slow_query_log = 1
: ^3 p# m+ k# n6 L1 M4 ~* x) f) oslow_query_log_file = /var/log/mysql-slow.log
, l4 {8 e Z+ A# N4 j% a+ ?" q2 tlong_query_time = 2 ; R/ Y1 C9 R" x. t
隞乩撟曇交:2 w4 W* c" \ P# a3 G) ^. R6 N/ s
- E2 R+ S. |3 v- w
slow_query_log = 1& |: j% Y+ j; f O' u4 S
蝝瑁Y SQL 隤:( Z( K7 y9 D9 H% U
) i- ?5 b2 {4 v
slow_query_log_file = /var/log/mysql-slow.log
# Q( @+ r; n5 i# N閮剖蝝瑼雿蝵桀 /var/log/mysql-slow.log
* f9 a* C; I& I# V; c- t6 i% T) K( M
long_query_time = 2- I+ z6 F/ g7 D9 E
閮剖 SQL 隤亙瑁頞 2 蝘, 靘踵撠 SQL 隤亙脣
, }4 W/ V2 u: y! ]) ^% A! A
2 f' Y1 x3 ]4 B0 ?靽格孵末 my.cnf 敺, 啣 MySQL 靘踹鈭- i* R- c0 n1 [' L# m( h" O1 `% o
2 o+ g, a3 l8 _' h
$ ~6 U4 c! O) c4 k0 @) m
|
|