
STEP #1
Make sure you have backups of those .frm
and .ibd
files in /tmp/innodb_data
STEP #2
Get the CREATE TABLE tags
statement and execute it as CREATE TABLE mydb.tags ...
. Make sure it is the exact same structure as the original tags.frm
STEP #3
Delete the empty tags.ibd
using MySQL
ALTER TABLE mydb.tags DISCARD TABLESPACE;
STEP #4
Bring in the backup copy of tags.ibd
cd /var/lib/mysql/mydb
cp /tmp/innodb_data.tags.ibd .
chown mysql:mysql tags.ibd
STEP #5
Add tags
table to the InnoDB Data Dictionary
ALTER TABLE mydb.tags IMPORT TABLESPACE;
STEP 6
Test the table’s accessibility
SHOW CREATE TABLE mydb.tags\G
SELECT * FROM mydb.tags LIMIT 10;
If you get normal results, congratulations you import an InnoDB table.
STEP 7
In the future, please don’t delete ibdata1 and its logs