Sometimes you find yourself in a bad situation where your only
hope of recovering your InnoDB data lies in a handful of .frm and
.ibd data files that were heretofore part of a working MySQL
installation. It could be the case that someone thought backing
up InnoDB tables was simply a matter of of copying the .ibd and
.frm files somewhere safe. That mostly works for MyISAM files
right? Perhaps your system table space (ibdata1) became corrupted
or was accidently deleted. Whatever the reason, you have a
handful of .frm and .ibd files, and what you want is them
imported into a functioning database.
The basics of how to do this are not too hard to understand, it’s
the details that get tricky. The first part of this problem is
how to extract the table definition from the .frm files. I’ll
cover the second part of the problem in another post. You could
write a program that reads and parses the .frm file and outputs
the table definition, but …
[Read more]