错误的MySQL更新查询后恢复? [英] Recovery after wrong MySQL update query?

查看:83
本文介绍了错误的MySQL更新查询后恢复?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在表中输入了错误的更新查询.

I made a wrong update query in my table.

我忘记在WHERE子句中创建一个id字段.

I forgot to make an id field in the WHERE clause.

这样就更新了我所有的行.

So that updated all my rows.

如何恢复呢?

我没有备份....

推荐答案

对不起,但是恢复被覆盖的

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服务器,并复制包含数据库的物理目录,以使任何内容都不会被进一步覆盖:简单地将data文件夹复制并粘贴到其他位置应该做.

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自己的

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.

这篇关于错误的MySQL更新查询后恢复?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆