Background
MySQL in the process of use, inevitably encountered database table error operation, based on this, the author pro-Pro, the MySQL data table ibd File Recovery To do the following detailed description of the development or the primary DBA to provide some guidance, if there are related issues in the blog, please specify, mutual learning and common progress.
Recovery instructions
- Create DATABASE (create it YYGK)
- Create a data table
Note: Row_format to be consistent with the Row_format of IBD files, otherwise it will prompt for inconsistencies. Current Row_format=dynamic
- Properties of the Table view
We use: Show table status like ' T_dict ' \g, view the properties of the table as follows.
Note: Careful we found that the creation of the table when the Row_format and table properties of the inconsistency, based on InnoDB is, to set the Row_format to dynamic, you need to modify the global configuration of MySQL, directly in the MYQL command to modify: Set global Innodb_file_format=barracuda;
- Table error Message View
From the error log we found that: Row_format Setup failed, follow the instructions in table 3rd, modify it in the MYQL command: Set global Innodb_file_format=barracuda, and then recreate the table.
- Description
When we restore the table, to ensure the consistency of Row_format and IBD files, if the IBD file is compact, the need to build a table, set to Row_format=compact, when the recovery, self-solve, starting from the 6th step, focus on how to recover.
- Restore first step: Remove table space
ALTER TABLE t_dict DISCARD tablespace;
- Recovery Step Two: Put the backed-up IBD file into the database name-> created by mysql->data->, and copy ibd to this directory, as shown in
- Recovery Step Three: Re-importing table spaces
ALTER TABLE t_dict IMPORT tablespace;
- Postscript
When we finish to the previous step, we find that the data in the database has been fully recovered. Praise. Praise. I would like to learn more about MySQL in the future, master the DBA's skills and apply it to project development. End!!!!
Mysql ibd File Recovery Guide