Mysql – How to extract the table schema from just the .frm file

innodbMySQLrecoveryschema

I have extracted the data directory of mysql from a backup and need to get the schema from an old table, however it's a backup from a different machine.

I have read a fair number of tutorials today on how to do this, but each time it seems to fail or I end up having to reinstall mysql because mysql hangs or crashes. I have tried the following:

  • Create a different database
  • Create table with same name in that database
  • Replace file
  • Stop/Start engine
  • Recover from the .frm file

I have tried in various orders and combinations.

Is there any external tool that can extract the schema from the .frm file? I can see the column names if I open up the file. I had a look but I can't seem to find anything that will enable me to do this.

Thanks in advance.

Best Answer

At TwinDB we built a web interface to mysqlfrm. It's free and easy to use.

To recover table structure from you just need to upload the .frm file.

Here are steps. 1. Open https://recovery.twindb.com/ . Click on "Recover Structure" enter image description here

  1. In next submenu click on "from .frm file" enter image description here

  2. On the next view click on "Browse" and select an .frm file on a local disk. Click on "Upload" enter image description here

  3. Wait till it's doing the magic enter image description here

  4. Get the recovered structure. enter image description here

It's also possible to upload an archive with a bunch of .frm files. The site will recover them altogether.