0

My problem is finding MySQLL database using .ibd files, the problem is that I do not have access to the .frm file and due to problems with the hard drive I had to change the operating system and restart the entire MySQL I installed, how can I recover these databeses ??? !!!

1 Answer 1

1

If you have the original SQL statements used to define the tables, you can create new empty tables. That will give you the .frm files you need.

Then you can try to attach the .ibd files you have using importable tablespaces. But those .ibd files probably don't have the required import files. There are blogs about how to binary-edit tablespace files to modify the tablespace id so you can attach it. This is not a solution for a novice.

Honestly, you're better off restoring from a recent backup.

If you didn't make a recent backup, then this will be an unfortunate learning experience about the importance of making backups.

3
  • 1
    Be sure to read the manual for your MySQL version. There were some changes between 5.6 and 5.7 re "tablespaces".
    – Rick James
    Commented Dec 18, 2020 at 17:06
  • 1
    i found it easier to modify space id in the InnoDB dictionary vs changing it in every page of the tablespace. Even more easier though is to dump records from the ibd file and load them into a healthy database instance.
    – akuzminsky
    Commented Dec 19, 2020 at 17:39
  • Thanks for that comment! The average user has not studied InnoDB internals or practiced data recovery for years like you have. :-) They should either hire your service for data recovery (twindb.com) or else just restore from a recent backup. Commented Dec 19, 2020 at 19:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.