简体   繁体   English

MySQL-从备份文件还原数据库,但也保留较新的记录

[英]MySQL - Restore DB from backup file but also keep newer records

I perform a full MySQL db backup twice a day creating a MySQL dump file. 我每天执行两次完整的MySQL数据库备份,创建MySQL转储文件。 Some records were accidentally deleted but when I realized the missing data, several more records had been added. 有些记录被意外删除,但是当我意识到缺少数据时,又添加了几条记录。

What's the best way to restore the missing data without losing the newer data as well? 在不丢失新数据的情况下还原丢失的数据的最佳方法是什么? Maybe by replacing the INSERT with REPLACE in the dump file? 也许通过在转储文件中用REPLACE替换INSERT? Or is there a better way? 或者,还有更好的方法?

是的,根据最小的努力和清晰的工作, REPLACE是最好的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM