当前位置:网站首页>mysql通过binlog文件恢复数据
mysql通过binlog文件恢复数据
2022-04-23 14:00:00 【白云碎里一蓑舟】
-
将dump下来的压缩包解压到 /data/dumpback/目录下
tar -zxvf back_20220322.tar.gz -C /databak/data -
进入mysql执行
#登录mysql mysql -uroot -p -S /data/mysql/mysql.sock #选择目标数据库 use zzz_test; #执行sql文件(定时备份的数据恢复完成 source /data/dumpback/data/mysql/20220322/zzz_test.sql -
使用binlog日志将dump时间之后的数据恢复
#查看binlog日志开启状态(on为打开) show variables like 'log_bin'; #查询 BINLOG 格式 show VARIABLES like 'binlog_format'; #查看 master 正在写入的 BINLOG 信息 show master status\G; #退出mysql exit#cat /etc/my.cnf 查看二进制日志存放目录 log_bin=/data/mysql/logs/mysql-bin# 查看binlog文件(mysql重启一次,binlog文件名会变化一次 mysqlbinlog mysql-bin.000006#根据时间区间将binlog文件转成.sql文件查看 /usr/bin/mysqlbinlog --no-defaults --database=zzz_test --base64-output=decode-rows -v --start-datetime='2022-03-25 09:39:10' --stop-datetime="2022-03-25 13:42:10" /var/lib/mysql/my-logbin.000069 >/databak/data/binlog.sql#跟据时间执行二进制文件(恢复备份时间之后的数据内容 /usr/bin/mysqlbinlog --database=zzz_test --start-datetime='2022-03-25 13:53:29' --stop-datetime='2022-03-25 13:55:01' /var/lib/mysql/my-logbin.000069 | mysql -uroot -p123456
版权声明
本文为[白云碎里一蓑舟]所创,转载请带上原文链接,感谢
https://blog.csdn.net/m0_49513507/article/details/123665551
边栏推荐
- 读了一篇博客,重新理解闭包整理一下
- Spark入门基本操作
- freeCodeCamp----arithmetic_ Arranger exercise
- Quartus Prime硬件实验开发(DE2-115板)实验二功能可调综合计时器设计
- 收藏博客贴
- 生成随机高质量符合高斯分布的随机数
- 程序编译调试学习记录
- Solution of discarding evaluate function in surprise Library
- The latest development of fed digital currency
- [code analysis (4)] communication efficient learning of deep networks from decentralized data
猜你喜欢

Detailed explanation of redis (Basic + data type + transaction + persistence + publish and subscribe + master-slave replication + sentinel + cache penetration, breakdown and avalanche)

【报名】TF54:工程师成长地图与卓越研发组织打造

freeCodeCamp----arithmetic_ Arranger exercise

UML统一建模语言
![MySQL index [data structure + index creation principle]](/img/11/6bdc8a62e977ffb67be07ded0c8978.png)
MySQL index [data structure + index creation principle]

The art of automation

Decentralized Collaborative Learning Framework for Next POI Recommendation

【vmware】vmware tools 地址

Question bank and answer analysis of the 2022 simulated examination of the latest eight members of Jiangxi construction (quality control)

The latest development of fed digital currency
随机推荐
容差分析相关的计算公式
【项目】小帽外卖(八)
leetcode--977. Squares of a Sorted Array
Choreographer全解析
Android 面试主题集合整理
Postman reference summary
Force deduction brush question 101 Symmetric binary tree
New关键字的学习和总结
Taobao released the baby prompt "your consumer protection deposit is insufficient, and the expiration protection has been started"
Question bank and answer analysis of the 2022 simulated examination of the latest eight members of Jiangxi construction (quality control)
YARN线上动态资源调优
JS brain burning interview question reward
Interesting talk about network protocol
MySQL 修改主数据库
Three characteristics of volatile keyword [data visibility, prohibition of instruction rearrangement and no guarantee of operation atomicity]
About note 1
Record a strange bug: component copy after cache component jump
初识go语言
Un modèle universel pour la construction d'un modèle d'apprentissage scikit
Problems encountered in the project (V) understanding of operating excel interface poi