MySQL Bin Log SQL Extractor
used to extract SQL for specific table from bin log.
It accepts SQL file generated by mysqlbinlog
program.
$ python binlog-extract.py
Usage: binlog-extract.py [options] SQL-FILE
SQL-FILE should be SQL file generated by mysqlbinlog program.
Options:
-t, --table tablename Specify tablename to be extracted
Can be supplied multiple times to extract more tables
-o, --out filename Specify out filename to write to
-d, --debug Turn on debugging
Example:
binlog-extract.py -t mytable /path/to/my/file
$ mysqlbinlog --skip-gtids -D -d mydb mysql-binlog.* > mydb.sql
$ python binlog-extract.py -t table1 -t table2 -o out.sql mydb.sql
And check out.sql
for result.