Recover MySQL Database from FRM and IBD Files – Easy Tips

  • Written By  

  • Published on August 17th, 2023

  • Updated on April 17, 2024

5/5 - (2 votes)

Losing access to your MySQL database can be a nightmare, but fear not! There’s a way to recover your valuable data using the FRM and IBD files. These files hold the structure and actual information of your database. In this guide, we’ll walk you through the best way to recover MySQL Database from FRM and IBD Files step by step. In fact, you can directly use Cigati MySQL Database Repair Tool to recover corruption.

Download Now    Buy Now

FRM files contain the structure and definition of your database tables, while IBD files store the actual data, such as your usernames, passwords, etc. FRM files hold the plans for how your tables should look. When you lose access to your MySQL database, these files can become your lifeline to restoring your data.

Why Restore Tables Data from the FRM and IBD Files?

So, now the question arises regarding why you need to recover your database using these files. Well, think about all the stuff you’ve stored inside your database. Losing information could be a big problem! There are possible reasons that will highlight the common reasons for that.

  • You might accidentally delete some valuable data from your database.
  • Sometimes, hiccups make things go missing. Your data might disappear due to these hiccups.
  • Database upgrades play tricks, and your data might vanish during the process.
  • Power failures, while your database is working, can cause your treasures to vanish too.
  • Sometimes, hackers might target your database, making your data disappear.
  • Moving your database to a new computer or server leads to data loss.
  • Changing database settings based on advice can lead to lost data too.

Here are some common reasons to Restore Data from the FRM and IBD Files. Now, we’ll move further to get to know the possible way for the same.

Also Read: MySQL Shutdown Unexpectedly

How to Recover MySQL Database from FRM and IBD Files?

Before starting any recovery process, it’s essential to back up your existing FRM and IBD files. It ensures you have a safety net in case anything goes wrong during the recovery process. The following section has several stages to Recover the Database from FRM and IBD Files. You just need to check them out.

Stage 1: Create MySQL Databases to Recreate the Table

We’ll use a tool, phpMyAdmin, to do this.

  • To start, you need to log in to phpMyAdmin.
  • In the “Create database” section, assign a name to your database. Then, tap the “Create” button.
  • You’ve got a brand-new database, employee.
  • Find your MySQL database where it is located.
  • The database doesn’t have all its tables – .FRM and .IBD files yet.
  • You step into the “employee” database and get no tables.

Stage 2: Search For The Table Schema

Let’s dive to help you to rescue lost table plans for your MySQL database. If you have a table schema, skip ahead.

  • Download MySQL Utilities.
  • Mysqlfrm is a tool that can save the day by bringing back lost table blueprints.
  • Then, you mention the Mysqlfrm tool to find your missing table plan. Here is the command you need to say:

mysql.FRM –diagnostic path filename.frm path

  • After that, you can see some parts of the table structure again.
  • You can use the above command to restore FRM files, but it can’t recover everything.
  • Opt for this command to rescue information from your FRM files:

mysqlfrm –server=root@127.0.0.1 –port 3307 ./filename.frm

Stage 3: Create a New .FRM and .IBD Files

Alright, let’s add a new table to your database. You open the database file and add a script used in the above section for the table. Now, you have a new table.FRM and .IBD files, ready to store and organize your data.

Stage 4: Delete The Newly .ibd File

  • Follow this command to remove the newly created.IDB file:

ALTER TABLE table_name DISCARD TABLESPACE

  • It will successfully split the link between MySQL and the tablespace to delete the .IBD file.
  • Now, copy the actual .IBD file in the new Database.

Stage 5: Import Tablespace in MySQL

Now, you can recreate the connection between the MySQL table and tablespace. After the completion process of the actual .IBD file, follow the below command:

ALTER TABLE table_name IMPORT TABLESPACE;

Here is the solution to Recover MySQL Database from FRM and IBD Files. If you are still facing multiple problems in your My SQL application, it simply indicates your database is severely damaged. If you want to repair your corrupted or inaccessible FRM and IBD files, opt for the Cigati My SQL Database Repair Tool. It will recover corruption from your damaged files without data loss.

Final Thoughts

Don’t worry if your MySQL database disappears! With this guide, you can get it back using FRM and IBD files. The above procedure helps you to Recover MySQL Database from FRM and IBD Files. Moreover, it also helps you put your valuable information back where it belongs.

You May Also Read: MySQL is Marked as Crashed and Should be Repaired

About The Author:

Saumya is a proficient technical content writer with a deep passion for technology and a natural talent for writing. She excels in creating compelling and informative content that captivates readers on technology websites. Her areas of specialization include data migration, Email backup, and recovery, where her vast expertise enables her to develop superior-quality content that is both educational and stimulating.

Related Post

100% safe and secure100% Safe & SECURE
SupportLifetime Support (24X7)
Money BackMoney Back Policy
Trusted by CustomersTrusted by 10000+ Customers