You are here

MySQL Binary Log and original SQL statement

Hello all

we use MySQL binary logging with binlog_format = row. With mysqlbinlog -v binary-log.000001 we can see proximately how the original query looked like. But this is a transformation from row events into pseudo SQL statements.

How can we see the original SQL statements again?


Taxonomy upgrade extras: 

Hi oli

Since MySQL 5.6.2 there is a new MySQL variable called binlog_rows_query_log_events. If you enable this variable MySQL will write the original SQL statements into the binary logs. More information about this variable you can find here:

To see the original queries you can either run SHOW BINLOG EVENTS ... in the MySQL client or you can run mysqlbinlog -vv binary-log.000001

I hope, this helps?