蝔撘 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)
7 f$ N. |1 ~+ u- q
蝚砌蝔: 閮 MySQL Replication binlog: - log_bin = /var/log/mysql/mysql-bin.log (甇斗閬 mysqlbinlog 閫靘)
- mysql 撠 INSERT/UPDATE/DELETE 隤瘜閮潭迨(雿航瘜航質雿喟銝), 航撖怎策 SLAVE 函 log 瑼) E8 A' E$ i. V9 V0 j9 g
蝚砌蝔: 刻行迨寞, 撠 MySQL 瑁瘥銵隞文券質韏瑚: - log = /var/log/mysql/mysql.log! x2 X( e' Z9 O5 B5 Q# |
restart mysql 敺, tail -f /var/log/mysql/mysql.log 撠勗臭誑啣!
& |6 K7 B! x$ y |