mysql 数据迁移

mysql> create table innodb_table like myisam_table;
mysql> alter table innodb_table engine=innoDB;
mysql> insert into innodb_table select * from myisam_table;

1,复制myisam存储引擎的表到新表

2,将新表的存储引擎改为innodb

3,将原表中的数据插入到新表中;数据量大可以选择批量处理

mysql> start transaction;
mysql> insert into innodb_table select * from myisam_table where         
       -> id between x and y;
mysql> commit;

    

 

posted @ 2020-09-29 14:58  潜台词  阅读(67)  评论(0编辑  收藏  举报