I am trying figure out how to "query" binlogs to see what was exectued in the database for a specific date. For example, if I execute mysqlbinlog binlog then the thing just runs forever and it is had to see what exactly was executed there, especially if binlog is huge. Thank you!
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
You can give mysqlbinlog datetime stamps
Here is a sample datadir folder
Suppose you want to see everything executed from 10:45 AM to 2:25 PM on Aug 14th. All of Aug 14th is in
If your range was Aug 13th 5:00PM to Aug 14th 2:00AM, you must span two binary logs. So, you would run the following:
Give it a Try !!!
quickest way I'd do it,
mysqlbinlog | grep 'YYYY-MM-DD HH:MM'
if you are setting the max binlog size to a high value or even not setting it at all (I think the default is 2 GB) then that is why mysqlbinlog takes a while to translate it and that is just how it's gonna be
another reason to make the bin log files huge and take a while to parse, is the replication mode you're using. Row based files are larger.