衡铁刚 1)2011-2013:Alibaba MySQL DBA 2)2014-至今: Alibaba 数据库PD
分类: Mysql/postgreSQL
2012-10-05 23:43:45
binlog-format={ROW|STATEMENT|MIXED}
从statement到row,binlog记录内容改变了很多,但有些问题需要查看binlog才能定位
1.statement
SHOW BINLOG EVENTS in 'mysql-bin.000001' from 4 limit 10;
但是在row模式下无法通过上述语句查看binlog内容
2.row
mysqlbinlog --no-defaults -v -v mysql-bin.000001 | grep 11:11 | grep -C 20
-B, --before-context=NUM print NUM lines of leading context
-A, --after-context=NUM print NUM lines of trailing context
-C, --context=NUM print NUM lines of output context
-m, --max-count=NUM stop after NUM matches