InnoDB Recovery from .frm .ibd files

A happy-end-horror-story the making of.. prerequisites for my recovery plan assuming that you had/have the following InnoDB setting:

  • A recovery (development/virtual) machine
  • MySQL Utilities for schema (CREATE TABLE) recovery
  • XAMPP for rebuilding your databases

Create a recovery database

Start XAMPP and create a new database in my case ‘mydatabase’ got moved and stopped working and I created a ‘mydatabase_recovery’ database.

Install the MySQL Utilities and navigate to the installation location and open a command prompt:

This creates the create_mydatabase.sql file which contains the original structure CREATE TABLE code for your database. You can now change the file’s content occurences of ‘mydatabase’ to ‘mydatabase_recovery’ and execute it in your new database.

Once you’ve got your tables back do the following for each new table in ‘mydatabase_recovery’, this will delete the (.idb) data file for your new tables.

Now copy your .ibd files from your copied files to the following directory:

Make sure it has the same user rights and reassociate/import the data files (.idb) with the following code:

And check your table, if all went well you got your data back!

If you have MyISAM files as well just copy the .MYD (MyISAM data) files and execute the following for those tables:

And MySQL will fix your .MYI (MyISAM indexes) files, fortunately MyISAM is easier/more forgiving with restoring.


Hopefully you now no longer see the following errors:

15 thoughts on “InnoDB Recovery from .frm .ibd files”

  1. Hi,

    Thank you very much for your tutorial! I have followed all the steps with success and I was able to save my databases!

    1. Glad to hear it worked! That was the whole purpose of sharing this tutorial/information in the first place! 🙂 And next time: backups! 😉

    1. BTW, if you get the compact and dynamic error – put this at the end of TABLE creation query – row_format=compact;

  2. Still near 2018 thank you very much

    MySQL Utilities didnt work on my maschine but i found this free service !

    recover Structure -> from .frm file

    this and your tutorial very simple after 12 hours testing so much 😀

    1. Nice! Don’t forget to invest in a decent backup strategy and you’re off to the better half of 2019 without database troubles! 😀

  3. Hi, i tried your solution but kept getting getting “ERROR: The process “12092” not found”

    Please what is the solution?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.