很多时候,MYSQL数据库由于一些误操作,需要恢复指定表,或某个表指定时间点的数据,这个时候需要根据MYSQL的binlog日志做时间点的恢复,下面将介绍这个方案的具体步骤:
一、登录数据库刷新binlog
1.1)查看当前的binlogshow master status;
+---------------------+----------+--------------+------------------+-------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+---------------------+----------+--------------+------------------+-------------------+
| test-150-bin.000003 | 2895377 | | | |
+---------------------+----------+--------------+------------------+-------------------+
1 row in set (0.00 sec)
1.2)刷新binlogmysql> flush logs;
Query OK, 0 rows affected (0.01 sec)
1.3)确认刷新binlog成功mysql> show master status;
+---------------------+----------+--------------+------------------+-------------------+
| File | Position | Bi