Mysql入门到精通-通过bin-log查询数据变更历史记录

首先查询bin-log文件

show master logs;

show binlog events in 'log-bin.000005' ;

cd 到binlog的目录下

-- 查询log输出

mysqlbinlog  --no-defaults --base64-output=decode-rows -v log-bin.000005

-- grep 过滤

mysqlbinlog  --no-defaults --base64-output=decode-rows -v log-bin.00
0005 | grep 'xxxx'

-- grep 上下10行
mysqlbinlog  --no-defaults --base64-output=decode-rows -v log-bin.000005 | grep -A10 -B10 'xx'
 

猜你喜欢

转载自blog.csdn.net/wxb880114/article/details/112983703