Mysql ibd 数据库文件导入

Server1: 源数据库

Server2: 目标数据库

Table1: 需要导入的数据表

1. 在源数据库中锁表

USE database1;
FLUSH TABLE Table1 FOR EXPORT;

2. 复制相关文件到目标Server: 在sever1中操作。

scp /var/lib/mysql/database1l_scm2_f_rd_record* root@server2:/var/lib/mysql/database1

3. 修改目标server的权限

chown mysql.mysql /var/lib/mysql/database1/

4. 导入目标表

truncate table table1;
alter table table1 import tablespace;

http://dev.mysql.com/doc/refman/5.7/en/tablespace-copying.html

http://dev.mysql.com/doc/refman/5.7/en/innodb-transportable-tablespace-examples.html

猜你喜欢

转载自www.cnblogs.com/Jesse-Li/p/11508503.html
今日推荐