//Run as mysql user
//Note that Mysql is running at this time because we are doing individual table restore.
RESET MASTER; //(To escape gtid error)
Create the schema for the table;
SET foreign_key_checks = 0;
ALTER TABLE <table> DISCARD TABLESPACE;
SET foreign_key_checks = 1;
rm -rf <table>.exp <table>.ibd
tar vxzf ${_exp_backup_filename} -C $_mysqldatadir/$dest_db_name //extracting exp file into mysql datadir
ALTER TABLE <table> IMPORT TABLESPACE;
File permission after the process looks like - //I did not change anything
[mysql@host ~]$ ls -al _db/test_table*
-rw-r--r-- 1 mysql other_user 16384 Oct 3 13:12 _db/test_table.exp
-rw-r----- 1 mysql other_user 163840 Oct 10 02:30 _db/test_table.ibd
Restore steps are -
//Run as mysql user backup_ filename} -C $_mysqldatadir/ $dest_db_ name //extracting exp file into mysql datadir
//Note that Mysql is running at this time because we are doing individual table restore.
RESET MASTER; //(To escape gtid error)
Create the schema for the table;
SET foreign_key_checks = 0;
ALTER TABLE <table> DISCARD TABLESPACE;
SET foreign_key_checks = 1;
rm -rf <table>.exp <table>.ibd
tar vxzf ${_exp_
ALTER TABLE <table> IMPORT TABLESPACE;
Mysql.err table.ibd: Page 8 at offset 131072 looks corrupted. table1. ibd: Page 7 at offset 114688 looks corrupted. table2. ibd: Page 7 at offset 114688 looks corrupted. table3. ibd: Page 7 at offset 114688 looks corrupted. table4. ibd: Page 7 at offset 114688 looks corrupted.
[Warning] InnoDB: ./_db/test_
[Warning] InnoDB: ./_db/test_
[Warning] InnoDB: ./_db/test_
[Warning] InnoDB: ./_db/test_
[Warning] InnoDB: ./_db/test_
File permission after the process looks like - //I did not change anything
[mysql@host ~]$ ls -al _db/test_table*
-rw-r--r-- 1 mysql other_user 16384 Oct 3 13:12 _db/test_table.exp
-rw-r----- 1 mysql other_user 163840 Oct 10 02:30 _db/test_table.ibd
Attaching Restore output.