二进制日志节点恢复时不显示--start-position=‘1250‘后的操作以及查看二进制文件时没有数据库相关操作内容

问题一

  • 查看二进制文件时没有数据库相关操作内容
  • 因为在创建库及表格以及插入内容的相关操作时在开启二进制日志功能之前进行的。开启二进制功能后只进行了一条插入操作,所以查看时空白,恢复时无效。应先开启二进制日志功能再进行相应操作以及模拟数据丢失

问题二

  • 二进制日志节点恢复时不显示–start-position='1250’后的操作
  • 原因:在位置节点1250后的1613节点又执行了删除表的操作
# at 1154
#210420 12:11:04 server id 1  end_log_pos 1250 CRC32 0xdcdc9e2b 	Query	thread_id=3	exec_time=0	error_code=0
SET TIMESTAMP=1618891864/*!*/;
insert into qa values(002)
/*!*/;


# at 1613
#210420 12:11:23 server id 1  end_log_pos 1724 CRC32 0x9b9f4718 	Query	thread_id=3	exec_time=0	error_code=0
SET TIMESTAMP=1618891883/*!*/;
DROP TABLE "qa" /* generated by server */
/*!*/;


[root@192 data]# mysqlbinlog --no-defaults --stop-position='1154' mysql-bin.000009 | mysql -uroot -p5514
mysql: [Warning] Using a password on the command line interface can be insecure.
[root@192 data]# mysqlbinlog --no-defaults --start-position='1250' mysql-bin.000009 | mysql -uroot -p5514
mysql: [Warning] Using a password on the command line interface can be insecure.


mysql> select * from qa;
+------+
| id   |
+------+
|    4 |
|    3 |
+------+
2 rows in set (0.00 sec)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

TaKe___Easy

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值