Having MySQL dumping out binary logs is a very good failsafe for backup redundancy. But, how do you get any of the information out of them?

If you know a time span that you need to investigate, then you can easily use the mysqlbinlog utility:

mysqlbinlog --start-datetime="2010-07-27 14:30:00" --stop-datetime="2010-07-27 15:00:00" > backup.txt

This will export all the recorded SQL Statements performed between 2:30pm and 3pm on the 27th July 2010 to the text file “backup.txt”. I can then browse at my convenience.

If you need to re-create any of the statements, you can copy and paste into your MySQL client of choice.

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.