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?

Regards,
Oli

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:

http://dev.mysql.com/doc/refman/5.6/en/replication-options-binary-log.ht...

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?

Regards,
shinguz

Shinguzcomment