Import .IBD files into MySQL server

Viewed 8355

I am trying to find a way to import "old copied" .ibd files into a new installed MYSQL Server 8.0

1 Answers

You will need to know the exact structure of the table (the CREATE TABLE statement).

  1. Create the table with the same structure.
  2. Run ALTER TABLE table_name DISCARD TABLESPACE;
  3. Copy the ibd file to table_name.ibd in the target location
  4. Run ALTER TABLE table_name IMPORT TABLESPACE;

This may not work if you didn't FLUSH TABLES table_name FOR EXPORT; before you backed it up.

Related