grep -A
-B
grep能找出带有关键字的行,以及该行前后的行
mysqlbinlog -vv mysql-bin.000095 |grep -B '20' 689446020
根据位置导入mysql
mysqlbinlog --start-position="1931" --stop-position="3701" /var/log/mysql/mysql-bin.000003 | mysql -uroot -p
检查数据是否恢复,搞定后使用mysqldump导出,再导入生产库即可。
注:如果还原到C时间点,可以跳过误操作的位点,继续恢复B时间点后的数据
1 mysqlbinlog --start-position="3851" /var/log/mysql/mysql-bin.000003 | mysql -uroot -p