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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM