且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

错误的 MySQL 更新查询后恢复?

更新时间:2023-02-02 17:23:44

对不起,恢复覆盖的机会 MySQL 数据库通常接近于零.与删除文件不同,在大多数情况下,覆盖记录实际上会覆盖现有数据.

Sorry man, but the chances of restoring an overwritten MySQL database are usually close to zero. Different from deleting a file, overwriting a record actually and physically overwrites the existing data in most cases.

要做好准备,如果出现任何问题,您应该停止 MySQL 服务器,并复制包含数据库的物理目录,这样就不会进一步覆盖任何内容:将数据文件夹简单复制 + 粘贴到其他位置应该做.

To be prepared if anything comes up here, you should stop your MySQL server, and make a copy of the physical directory containing the database so nothing can get overwritten further: A simple copy+paste of the data folder to a different location should do.

但不要抱太大希望 - 我认为真的没有什么可以做的.

But don't get your hopes up - I think there's nothing that can be done really.

您可能希望为将来设置频繁的数据库备份.周围有很多解决方案;MySQL 自己的 mysqldump.

You may want to set up a frequent database backup for the future. There are many solutions around; one of the simplest, most reliable and easiest to automate (using at or cron in Linux, or the task scheduler in Windows) is MySQL's own mysqldump.