MySQL5.6.6 after default Innodb_file_per_table=on, each table has two files after opening a separate table space:
. frm file contains table structure/definition
. ibd file contains data of table as well as index
Here are the InnoDB engine stand-alone table space tables in different servers such as move:
One, create the same table structure as the source table (must be the same as the table structure) on the destination side
1, source end: show create TABLE test.tb_name;
2, End: Create Database test;
CREATE TABLE Tb_name;
Second, discard table space
ALTER TABLE dst_tb_name DISCARD tablespace;
Third, copy the. frm and. ibd files to the corresponding database directory
CP tb_name.frm TB_NAME.IBD test/-RF
Chown MySQL. test/-R
Four, import table space
ALTER TABLE dst_tb_name IMPORT tablespace;
Five, renaming tables according to specific needs
Rename table Test.tb_name to Test.tb_name_bak;
This article is from the "Linuxdream" blog, make sure to keep this source http://books.blog.51cto.com/2600359/1682736
MySQL's InnoDB engine single-table porting