使用mysql的传输表空间 迁移表

A:
show create table pay_records \G
,copy the stament
################################################
B:use bigdata; paste the stament, find the table path on the disk,and
alter table pay_records discard tablespace
#########################################
A:
flush tables pay_records for export;
system scp /data/db/mysql3306/data/tybdata/pay_records.{cfg,ibd} root@IP:/data/mysql/bigdata/ unlock tables;
##############################
B:
chown mysql:mysql /data/mysql/bigdata/* Alter table pay_records import tablespace;
monkeybron

浙公网安备 33010602011771号