1.在线上创建一个与需备份相同表结构的表

create table table_name_temp as select * from table_name where 1=2;  

2.在线上创建一个与需备份表数据相同的表

create table table_name_temp as select * from table_name ;  ---注意并不会创建索引

 3.把备份表的数据写回到原始表

insert into table_name select * from table_name_temp;

 

enjoy;

相关文章:

  • 2021-05-07
  • 2021-12-19
  • 2021-11-20
  • 2022-01-09
  • 2021-05-18
  • 2021-09-13
  • 2021-05-20
  • 2021-11-28
猜你喜欢
  • 2022-01-16
  • 2022-12-23
  • 2022-12-23
  • 2021-06-26
  • 2021-12-23
  • 2022-12-23
相关资源
相似解决方案