Restore MySQL table structure from FRM and IBD files (without IB_Log file)
After losing the IB_log file, database data recovery seems to be tricky. However, the database table structure can still be restored using FRM and IBD files.
Here are the recovery steps:
1. Extract SQL creation statement:
mysqlfrm --diagnostic
command on each FRM file to obtain the SQL statement used to create the table. 2. Rebuild the table structure:
3. Delete new data:
ALTER TABLE example_table DISCARD TABLESPACE
command to eliminate the connection between the new FRM and IBD files. 4. Replace and import data:
ALTER TABLE example_table IMPORT TABLESPACE
command to import the original data and restore the table contents. The above is the detailed content of Can I Recover MySQL Table Structure Using FRM and IBD Files Without IB_Log Files?. For more information, please follow other related articles on the PHP Chinese website!