1

I need to clone a MySQL database from Binary Logs that were obtained from a tape backup. I've always backed-up mysql using mysqldump so I've never had to deal with binary logs (aside from replication) and I'm not sure if I'm approaching this problem correctly.

I need to use the bin logs to create a copy of the database so I can do some manual auditing and compare database integrity from a backup several weeks ago with the current database.

I put my bin logs in a tmp directory, concatenated them into the 'mysqlrestore' file, then tried to load them into a fresh Database in a VM:

# mysqlbinlog  mysqlrestore | mysql -u root -p

I've tried backups from various points and they all give me different errors, for example:

mysqlbinlog: unknown variable 'ssl-ca=/etc/mysql/ca-cert.pem'

and...

ERROR: Error in Log_event::read_log_event(): 'Event too small', data_len: 1, event_type: -46

In the past, to restore a backup I've always loaded a file from a mysqldump using:

# mysql -u root -p < from_mysqldump.sql

So before I go digging into these errors I just want to make sure I'm actually doing something that is possible.

ActionOwl
  • 1,473
  • 2
  • 15
  • 20
  • did you have any progress? It's interesting if you found an answer. – newtover Dec 10 '11 at 10:49
  • The only way you would be able to recreate the whole database with nothing but bin logs is if you had every binary log from the point you started adding data up to the restore date. The local LUG helped me solve this one, and the vendor that supplied our backup was able to provide a work-around to get us daily snapshot from the bin files by replacing the mysql binary file with a script: "cat > /tmp/database.dmp". Not a very pretty solution but it worked. http://mail.fortwaynelug.org/pipermail/fwlug_fortwaynelug.org/Week-of-Mon-20111128/001928.html – ActionOwl Dec 12 '11 at 01:03

0 Answers0