How Restore MYSQL Database Table Structure

This goes out to the web/software developers out there who most a times use MySQL as database for their applications.I was developing a web application and my database crashed(huh!).I really needed to recover the table structure(field names,types,sizes,rows,cols,etc) but had a couple of the .frm files .

I could not imagine myself entering all those field names again,so i decided to find a way to restore my table structure,the table type is innodb.I was not concern about the data.

I found a way to restore innodb with only .frm files:

First, create a database to restore and create tables with the same name of xxx.frm files (with one field,only to create the .frm files);

After,stop mysql service and replace the created .frm files with saved .frm files;

Finally, start mysql service and see, the tables are replaced with the old columns, but sure,without data.
Share