Comments
Brilliant! Will need to look into this for my clients.
Thanks for sharing.
There's also a --start-datetime switch (or something along those lines) for mysqlbinlog. If you know the exact time of your last backup you can use that and skip step 7.
Thanks for mentioning this, as this is a safety line I too wasn't aware of.
Glad you have your comments back, but remember... back up as you go :)
Yep! there's also an --end-datetime flag if you want data from a certain time period.
There's a took called mk-slave-delay from www.maatkit.org which some people use to have a time delay, but I've found that working with the binary logs is always the best bet, because there's no guarantee that a 1-hour delay or a 4-hour delay will be enough....it depends on when you realize there's a problem.
And there's basically no advance thought required -- just turn on the binary logs!
You can also use awk to extract only the queries you need from the binlogs.
mysqlbinlog /var/log/mysql/mysql-bin.* | awk 'comment_table/,/;/' | more







