MySQL's InnoDB engine single-table porting

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.