Home  >  Q&A  >  body text

How to undo an executed mysql UPDATE command

<p>While trying to make an update to the MySQL server, I accidentally forgot to add an extra WHERE clause that was supposed to edit a row. </p> <p>More than 3500 lines have now been edited due to my mistake. </p> <p>I may have a backup, but I've done a lot of work since the last backup and I don't want to waste all that work because of one bad query. </p> <p>Please tell me if there is any way to solve this problem. </p>
P粉464113078P粉464113078424 days ago504

reply all(2)I'll reply

  • P粉377412096

    P粉3774120962023-08-23 16:09:17

    Just a thought - could you restore the backup to a new database and then update that column via a cross-database query, based on the data it once had?

    reply
    0
  • P粉176203781

    P粉1762037812023-08-23 10:36:45

    If you've already submitted your transaction, it's time to take out the backup, sorry. But that's what backups are for. I made a similar mistake myself...once.

    reply
    0
  • Cancelreply