1.测试mysql binlog 数据恢复功能,我的mysql版本是5.7.17
2.删了数据之后,执行show binlog events 命令得到如下记录
3.找到开始删除和结束删除的位置,然后执行恢复命令:mysqlbinlog --no-defaults --start-position=8991 --stop-position=2904685 /Users/guojiaju/Documents/mysql_log/log_bin.000001 | mysql -u root -p
4.返回给我一个错误信息 ,ERROR 1790 (HY000) at line 51706: @@SESSION.GTID_NEXT cannot be changed by a client that owns a GTID. The client owns ANONYMOUS. Ownership is released on COMMIT or ROLLBACK.
5.如果我不加上结束位置:mysqlbinlog --no-defaults --start-position=8991 /Users/guojiaju/Documents/mysql_log/log_bin.000001 | mysql -u root -p
这样不会报错,但是数据没有恢复
6.执行这个命令 mysqlbinlog --start-position=8991 /Users/guojiaju/Documents/mysql_log/log_bin.000001 > /Users/guojiaju/Documents/mysql_log/test.sql 得到sql文件执行成功,但是数据库依然没有数据
7.请知道的大神给我指点一二,谢谢~~