images\cherry_red.png1 MySQL学习笔记
      images\cherry_blue.png1.1 LeetCode每日一题
         images\cherry_orange.png1.1.1 183. 从不订购的客户
      images\cherry_blue.png1.2 数据库特性
      images\cherry_blue.png1.3 正则表达式
         images\cherry_orange.png1.3.1 MySQL正则表达式
         images\cherry_orange.png1.3.2 Hive正则表达式
      images\cherry_blue.png1.4 MySQL基础操作语句
         images\cherry_orange.png1.4.1 增加
            images\cherry_cyan.png1.4.1.1 create
            images\cherry_cyan.png1.4.1.2 insert
         images\cherry_orange.png1.4.2 删除
            images\cherry_cyan.png1.4.2.1 drop
            images\cherry_cyan.png1.4.2.2 delete
         images\cherry_orange.png1.4.3 查询
         images\cherry_orange.png1.4.4 修改
            images\cherry_cyan.png1.4.4.1 update
            images\cherry_cyan.png1.4.4.2 alter
         images\cherry_orange.png1.4.5 基础操作命令
            images\cherry_cyan.png1.4.5.1 union
            images\cherry_cyan.png1.4.5.2 like
         images\cherry_orange.png1.4.6 复制表
         images\cherry_orange.png1.4.7 replace
      images\cherry_blue.png1.5 MySQL数据误删恢复
         images\cherry_orange.png1.5.1 docker远程连接MySQL报错
      images\cherry_blue.png1.6 MySQL主从之间的关系
         images\cherry_orange.png1.6.1 Binlog
      images\cherry_blue.png1.7 MySQL基本操作命令
         images\cherry_orange.png1.7.1 权限授予
         images\cherry_orange.png1.7.2 数据备份
         images\cherry_orange.png1.7.3 主从配置
         images\cherry_orange.png1.7.4 主从(主主)互用配置
         images\cherry_orange.png1.7.5 拉链表用途
            images\cherry_cyan.png1.7.5.1 拉链表
         images\cherry_orange.png1.7.6 字段类型转换
      images\cherry_blue.png1.8 Keepalived+MySQL 高可用架构
      images\cherry_blue.png1.9 HAproxy+MySQL 负载均衡
      images\cherry_blue.png1.10 Mycat+ MySQL 读写分离(高可用)优化
         images\cherry_orange.png1.10.1 Mycat配置文件详解
         images\cherry_orange.png1.10.2 安装配置Mycat
         images\cherry_orange.png1.10.3 MySQL分库操作
         images\cherry_orange.png1.10.4 Mycat测试实验
      images\cherry_blue.png1.11 MHA
         images\cherry_orange.png1.11.1 MHA初始化配置
      images\cherry_blue.png1.12 MySQL索引结构
      images\cherry_blue.png1.13 MySQL索引类型
      images\cherry_blue.png1.14 SQL执行计划(explain)
      images\cherry_blue.png1.15 SQL优化
      images\cherry_blue.png1.16 慢查询日志
      images\cherry_blue.png1.17 Druid监控
首先MYSQL 配置文件需要开启 binlog 日志

log-bin=mysql-bin
images\37-1.png


进入MySQL中查询 binlog日志

show binlog events in 'mysql-bin.000008';
images\37-2.png


找到需要恢复的Pos Start ---------------→ End
images\37-3.png


例如 Pos 705 到 Pos 889是我们所要恢复的内容

mysqlbinlog --start-position=705 --stop-position=954 /var/lib/mysql/mysql-bin.000008 | mysql -uroot -p
输入密码即可,这样被删除的数据即可恢复!