当前位置:网站首页>利用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
边栏推荐
猜你喜欢

Systrace 解析

imx6ull-qemu 裸机教程2:USDHC SD卡

Detailed explanation of device tree

带您遨游太空,美摄科技为航天创意小程序提供全面技术支持

Chapter 8 generative deep learning

机器视觉系列(01)---综述

北峰通信助力湛江市消防支队构建PDT无线通信系统

Int8 quantification and inference of onnx model using TRT

【点云系列】DeepMapping: Unsupervised Map Estimation From Multiple Point Clouds

北峰油气田自组网无线通信对讲系统解决方案
随机推荐
“泉”力以赴·同“州”共济|北峰人一直在行动
Chapter 5 fundamentals of machine learning
Mysql database installation and configuration details
PyTorch 17. GPU并发
安装 pycuda 出现 PEP517 的错误
南方投资大厦SDC智能通信巡更管理系统
AUTOSAR从入门到精通100讲(八十六)-UDS服务基础篇之2F
【点云系列】Neural Opacity Point Cloud(NOPC)
scons 搭建嵌入式arm编译
电力行业巡检对讲通信系统
Intuitive understanding of torch nn. Unfold
Modifying a column with the 'identity' pattern is not supported
x86架构初探之8086
PyTorch 10. 学习率
PyTorch 14. module类
Gather, unsqueeze and other operators when PTH is converted to onnx
unhandled system error, NCCL version 2.7.8
海南凤凰机场智能通信解决方案
armv8m(cortex m33) MPU实战
【点云系列】Relationship-based Point Cloud Completion