create table new_table like old_table;
–增加新索引
insert into new_table select * from old_table where id < 3;
lock tables old_table write, new_table write;
insert into new_table select * from old_table where id >= 3;
alter table foo new_table rename to old_table;
alter table old_table rename to new_table;
unlock tables;
Check Also
mysql Incorrect datetime value
从本地 迁移数据库到测试服 发 ...