蝔撘 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)4 D' Q0 t4 f! ]6 \% c$ M
蝚砌蝔: 閮 MySQL Replication binlog: - log_bin = /var/log/mysql/mysql-bin.log (甇斗閬 mysqlbinlog 閫靘)
- mysql 撠 INSERT/UPDATE/DELETE 隤瘜閮潭迨(雿航瘜航質雿喟銝), 航撖怎策 SLAVE 函 log 瑼* g0 A P# B7 q) ]0 B' T( W
蝚砌蝔: 刻行迨寞, 撠 MySQL 瑁瘥銵隞文券質韏瑚: - log = /var/log/mysql/mysql.log6 V; x; ^$ ]+ ~& `
restart mysql 敺, tail -f /var/log/mysql/mysql.log 撠勗臭誑啣!
8 i# x7 w6 s8 Q. D: C4 y |