Copy a table of type InnoDB from one server to another, or copy from one library to another.
The premise is: Innodb_file_per_table =on.
1 Create an identical table structure on the destination server (library) first.
Such as:
2 discarding the existing table space
3 on the source server (library), perform the flush*** for export operation to persist the cached data in buffer pool to the hard disk and generate a. cfg file.
4. The. cfg file and the. ibd file are in the target server (library).
The direct CP command is OK.
5 on the source server (library), perform UNLOCK TABLES to release the locked table "flush TABLES * * * for export"
6 on the destination server (library), Import tablespace for table space
As above, as I reported above, please modify the. cfg and. ibd file operation permissions for MySQL.
This makes it possible to quickly copy and transfer large table data.
Partitioning is handled in the same way as above.
Copy of InnoDB InnoDB table from one server to another server