The homepage of Chris Tate-Davies
Reading the MySQL binary log
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.
| Print article | This entry was posted by admin on July 27, 2010 at 4:28 pm, and is filed under IT, MySQL. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |