第一步:
./mysqlbinlog --no-defaults --database=shopeebao1688 --start-datetime="2020-07-01 00:00:00" --stop-datetime="2020-08-11 10:26:00" /www/server/data/mysql-bin.000012 > snake_pack.txt
第二步:
./mysqlbinlog --no-defaults --database=shopeebao1688 --start-datetime="2020-07-10 00:00:00" --stop-datetime="2020-08-11 10:26:00" /www/server/data/mysql-bin.000012 | grep snake_pack > snake_pack_log.txt
筛选指定表的指定操作语句:例如下面是筛选 UPDATE 语句
./mysqlbinlog --no-defaults --database=shopeebao1688 --start-datetime="2021-07-14 11:58:35" --stop-datetime="2021-07-24 12:18:00" /www/server/data/mysql-bin.000074 | grep -i -E '^update' | grep snake_goods > snake_goods_log.txt