I have a mysql database running with binary log enabled. Unfortunately, a statement was executed by the client, which turned out erroneous. Since a number of records have been "affected", I want to begin by parsing the bin-log for data-changing statements from that time period. Then we might be able to begin picking up the pieces.
I have used:
mysqlbinlog -v --base64-output=decode-rows --start-datetime="2015-06-26 08:30:00" --stop-datetime="2015-06-26 09:30:00" data/mysql-bin.000005 > C:\temp\binlog.txt
The output is quite intimidating. What I would appreciate is a strategy for parsing out any INSERT, UPDATE or DELETE statements. Keep in mind I'm on MIXED MODE.
Thank you.
Best Answer
When you have
binlog_format=MIXED
some statements will appear as actual SQL. Other statements may get obfuscated like this:That statement was possible to see because the
INSERT ... SET
syntax was used.Other statements may get obfuscated beyond recognition. This is the risk of using MIXED or ROW.
I have dealt with this recently
Jun 02, 2015
: Why binlog capture only postionsMay 15, 2015
: Show sql statements from mysql binlog (GTID)The only thing you can do is
There are no guarantees you will catch every change in statement form when mysqld switches to binlog_format ROW intermittently.