Restore MySQL table structure using only frm and ibd files
If the ib_log file is not available, is it possible to restore the table structure using only the frm and ibd files?
Answer:
Yes. In the absence of the ib_log file, the table structure can be recovered from the frm file.
Steps to restore table structure:
Extract SQL statements from .frm files:
mysqlfrm --diagnostic /path/to/example_table.frm
Create a table using SQL statements:
Recover data:
ALTER TABLE example_table DISCARD TABLESPACE
to delete any existing data in the newly created table. ALTER TABLE example_table IMPORT TABLESPACE
to import data from old .ibd files. The above is the detailed content of Can I Recover MySQL Table Structure Using Only frm and ibd Files?. For more information, please follow other related articles on the PHP Chinese website!