xiezhenye / binlog-undo

undo data with row format binlog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

binlog-undo

Undo lastest MySQL operations with row format binlog

This utility scans the binlog from specialized position to end and produces another binlog file that undos the operations in it. You can use mysqlbinlog to check and apply the produced binlog file.

Only supports row format binlog.

You can get binary releases for linux x86_64 here: https://github.com/xiezhenye/binlog-undo/releases

build

requirement

  • MySQL source code version >= 5.7
  • boost_program_options

Edit the Makefile, change the MYSQL_SRC to your MySQL source directory, then make.

usage

Allowed options:

-h [ --help ]                     print help message
-f [ --file ] arg                 binlog file
-p [ --position ] arg             position
-o [ --output ] arg               output file
-q [ --quiet ]                    be quiet
-m [ --max-event-size ] arg (=16) max binlog event size (MB)
-s [ --server-id ] arg            rewrite the specialized server id

e.g.

./binlog_undo -f /data/mysql/log-bin.000004 -p 3958 -o binlog.out

Produced binlog will be written to "binlog.out"

project home: https://github.com/xiezhenye/binlog-undo/

About

undo data with row format binlog

License:GNU General Public License v2.0


Languages

Language:C++ 94.6%Language:Makefile 5.4%