MySQL PITR Notes
PITR = "Point-in-Time (Incremental) Recovery"
See http://dev.mysql.com/doc/refman/5.1/en/point-in-time-recovery.html
create/drop db in binlogs
If "create/drop database" are included in mysqlbinlog for database X, --one-database cannot be used to restore database X, but "mysqlbinlog --database" might be a workaround. See http://bugs.mysql.com/bug.php?id=54896 .
mysql --one-database
- useful for loading only one database from a dump of many
- but see http://bugs.mysql.com/bug.php?id=54899 ... decoding with "mysqlbinlog --database mifos" may be a suitable workaround
disable binlog during PITR
use "mysqlbinlog --disable-log-bin", and the decoded binlog will include a statement to disable binary logging
mysqlbinlog example
mysqlbinlog --database mifos --disable-log-bin -vv --stop-datetime "2010-06-25 16:00:00" /mysql-bin.0* > /tmp/out.sql
don't hand-edit decoded binlog
example error caused by this:
ERROR 1609 (HY000) at line 53: The BINLOG statement of type `Table_map` was not preceded by a format description BINLOG statement.
"at" and "end_log_pos" are byte offsets
These values appear in decoded binary logs, and correspond to byte offsets in the actual binary log(s).