mysql 利用影子表实现数据换表

先创建一张和源表无关的新表,然后通过重命名和删表操作交换两张表;   

如果需要重建user,则可以像创建user_new,然后填充好数据,最后和真实表切换

    drop table if exists user_new,user_old

    create table user_new like user 

    raname table user to user_old,user_new to user

原文地址:https://www.cnblogs.com/haimishasha/p/12436963.html