1.目标端创建同样的表结构
CREATE TABLE `test` (
      `id` int(11) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2.目标端保留.frm文件,删除.ibd文件
alter table tbs.test discard tablespace;    
3.源端对表加一个读锁
flush table tbs.test for export;
4.拷贝.cfg和.ibd文件到目标端数据文件位置
scp test.ibd root@192.168.10.101:/usr/local/mysql/data/tbs
scp test.cfg root@192.168.10.101:/usr/local/mysql/data/tbs
5.源端释放锁
unlock tables;
6.目标端文件赋予权限
chown -R mysql:mysql *
chmod -R 755 *
7.目标端导入表
alter table tbs.test import tablespace;

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-06
  • 2021-09-16
  • 2021-05-24
  • 2021-08-24
  • 2021-11-14
猜你喜欢
  • 2021-09-22
  • 2021-05-19
  • 2021-06-25
  • 2021-09-03
  • 2021-08-13
  • 2021-09-14
  • 2022-12-23
相关资源
相似解决方案