蝔撘 Debug 敺敺Y洵銝銵餈質絲靘敺颲(蝔撘蝣澆云憭 compile ), 虫蝔桀瘜撠望臬敺W餈, 甇敺撖怠亦 DB, 撠勗 DB 憪敺, 隞亙停航蝔撘臬瑁芯 SQL 隤瘜.(隞乩芯誑 MySQL 箔蜓) 銋券餈質馱瘜舐 tcpdump wireshark 3306 port,憭芾 MySQL 撟曄車寞臭誑, 撠隞交甇∠嗡葉銝蝔, /etc/my.cnf(CentOS), restart mysql 喳: 蝚砌蝔: Slow query SQL 隤瘜: - log_slow_queries = /var/log/mysql/mysql-slow.log
- long_query_time = 2 (頞 2蝘 SQL 隤瘜閮韏瑚, 閮剔凋暺靘閮日臭臭蝔格寞 XD)
1 B1 W8 _2 X, X: ~! \# u( b* |' N
蝚砌蝔: 閮 MySQL Replication binlog: - log_bin = /var/log/mysql/mysql-bin.log (甇斗閬 mysqlbinlog 閫靘)
- mysql 撠 INSERT/UPDATE/DELETE 隤瘜閮潭迨(雿航瘜航質雿喟銝), 航撖怎策 SLAVE 函 log 瑼
$ W: e4 S5 i, e1 c
蝚砌蝔: 刻行迨寞, 撠 MySQL 瑁瘥銵隞文券質韏瑚: - log = /var/log/mysql/mysql.log
" _5 K+ F& T- G
restart mysql 敺, tail -f /var/log/mysql/mysql.log 撠勗臭誑啣! # N5 n: V7 W2 L2 y, b
|