views:

1712

answers:

2

I have to restore a database that has been inadvertently DROPped in MySQL 5.0. From checking the backup files, I only seem to have .FRM files to hold the database data.

Can anyone advise whether this is all I need to perform a database restore/import from the backup, or are there other files I should have to hand to complete this?

+1  A: 

.frm files are not the data files, they just store the "data dictionary information" (see MySQL manual). InnoDB stores its data in ib_logfile* files. That's what you need in order to do a backup/restore. For more details see here.

tpk
InnoDB requires the ibdata, ib_logfile*, and/or *.ibd files in addition to the *.frm files.
silfreed
what if you only have the ib_logfile* and the .frm files (along with a months old backup)? any chance to recover in that scenario? or do you need the ibdata to recover anything at all?
eglasius
+1  A: 

Oh my... you're in trouble. Shutdown the database. Backup the innodb file. Pray that you did NOTHING after you dropped the database.

The guys at Percona (includes authors of MySQL Performance Blog) should be able to help you out: Percona emergency support.

If you do venture on your own, take this with you: Data Recovery Toolkit for Innodb.

The logistics of it? You have to read every page (the computer term page... 16k block in the case of Innodb) in and rebuild your data that way. It's very low-level work (we're talking open up your hex editor and start counting bytes if the toolkit doesn't do it for you), and if you're not a strongly experienced programmer, you're going to be hurting.