Is there any way to rollback after commit in MySQL?(在 MySQL 中提交后有什么方法可以回滚吗?)
问题描述
我犯了一个大错误,我在 MySQL 中更新了一个没有 'where' 子句的表:'(
I did a big mistake that I updated a table without 'where' clause in MySQL :'(
它是自动提交的.
有什么办法可以回滚吗?
Is there any way to rollback from it?
推荐答案
不,没有查询可以撤消"已提交的数据修改查询.
No, there's no query that will "undo" a committed data-modifying query.
如果你有数据库的备份,你可以恢复备份并使用 DBA 工具(在 MySQL 的情况下,它是 mysqlbinlog) 以重播"自备份回数据库以来日志中的所有数据修改查询,但跳过问题查询.
If you have a backup of the database, you can restore the backup and use DBA tools (in MySQL's case, it's mysqlbinlog) to "replay" all data-modifying queries from the logs since the backup back to the database, but skip over the problem query.
如果您没有备份以及自该备份以来的所有日志,则您无法恢复数据.
If you don't have a backup and all logs since the that backup, there's nothing you can do to recover the data.
这篇关于在 MySQL 中提交后有什么方法可以回滚吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 MySQL 中提交后有什么方法可以回滚吗?


基础教程推荐
- 带更新的 sqlite CTE 2022-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01