当前位置:网站首页>利用mysql-binlog恢复数据
利用mysql-binlog恢复数据
2022-04-23 06:15:00 【小安灬】
1、数据准备
1、数据如下:共28条记录

2、模拟删除:DELETE FROM sys_dict_data WHERE dict_type=‘sys_oper_type’

2、使用binlog恢复数据



binlog内容查看
1、使用show binlog events:不怎么友好,可以参考第二种

2、使用 mysqlbinlog
1、通过binlog获取内容并输出到文件
-d: 根据数据库的名称筛选日志
-o:跳过前N行日志
-r, --result-fil: 把日志输出到指定文件
–start-datetime: 读取指定时间之后的日志,时间格式:yyyy-MM-dd HH:mm:ss
–stop-datetime: 读取指定时间之前的日志,时间格式:yyyy-MM-dd HH:mm:ss
–start-position: 从指定位置开始读取日志
–stop-position: 读取到指定位置停止
–base64-output:在row格式下,显示伪sql语句
-v, --verbose:显示伪sql语句,-vv可以为sql语句添加备注

2、通过查看sql,反解析出insert的sql语句进行恢复

版权声明
本文为[小安灬]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_17522211/article/details/120206553
边栏推荐
- 《Multi-modal Visual Tracking:Review and Experimental Comparison》翻译
- PyTorch 14. Module class
- AUTOSAR从入门到精通100讲(八十六)-UDS服务基础篇之2F
- [8] Assertion failed: dims. nbDims == 4 || dims. nbDims == 5
- UEFI学习01-ARM AARCH64编译、ArmPlatformPriPeiCore(SEC)
- 【技术规范】:如何写好技术文档?
- 【点云系列】Relationship-based Point Cloud Completion
- 美摄助力百度“度咔剪辑”,让知识创作更容易
- PyTorch 10. Learning rate
- Pymysql connection database
猜你喜欢
随机推荐
Face_ Recognition face detection
AUTOSAR从入门到精通100讲(五十)-AUTOSAR 内存管理系列- ECU 抽象层和 MCAL 层
Common regular expressions
江宁医院DMR系统解决方案
Systrace 解析
被 onnx.checker.check_model 检查出的常见错误
城市应急管理|城市突发事故应急通信指挥调度系统
Intuitive understanding of torch nn. Unfold
【点云系列】Pointfilter: Point Cloud Filtering via Encoder-Decoder Modeling
imx6ull-qemu 裸机教程1:GPIO,IOMUX,I2C
【点云系列】Relationship-based Point Cloud Completion
Warning "force fallback to CPU execution for node: gather_191" in onnxruntime GPU 1.7
Résolution du système
Chapter 2 pytoch foundation 2
PyTorch 12. hook的用法
基于51单片机的体脂检测系统设计(51+oled+hx711+us100)
UEFI学习01-ARM AARCH64编译、ArmPlatformPriPeiCore(SEC)
Gather, unsqueeze and other operators when PTH is converted to onnx
onnxruntime-gpu 1.7 出现的警告“Force fallback to CPU execution for node: Gather_191”等
基于51单片机的温湿度监测+定时报警系统(c51源码)









