目标库:
cd /usr/local/mysql/data/test
chown mysql:mysql *
CREATE TABLE t1 (
i1 int(11) NOT NULL DEFAULT '0',
i2 int(11) NOT NULL DEFAULT '0',
d date DEFAULT NULL,
PRIMARY KEY (i1,i2),
KEY k_d (d)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
alter table t1 discard tablespace;
源库:
flush tables t1 for export;
scp t1.* 192.168.168.144:/usr/local/mysql/data/test
unlock tables;
show create table t1\G;
目标库:
chown mysql:mysql *
alter table t1 import tablespace;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/91975/viewspace-1761774/
,如需转载,请注明出处,否则将追究法律责任。