Chinaunix首页 | 论坛 | 博客
  • 博客访问: 304753
  • 博文数量: 33
  • 博客积分: 586
  • 博客等级: 中士
  • 技术积分: 494
  • 用 户 组: 普通用户
  • 注册时间: 2012-09-27 14:05
个人简介

衡铁刚 1)2011-2013:Alibaba MySQL DBA 2)2014-至今: Alibaba 数据库PD

文章分类

全部博文(33)

文章存档

2016年(1)

2015年(10)

2013年(5)

2012年(17)

我的朋友

分类: 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


  • --no-defaults
mysqlbinlog读取my.cnf配置文件参数[client],报错 mysqlbinlog: unknown variable 'default-character-set=utf8',也可以将my.cnf中default-character-set = utf8注释掉



  •   -v, --verbose      
 Reconstruct SQL statements out of row events. -v -v adds comments on column data types.



  • grep可用参数

  -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

阅读(1286) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~