How can I undo a mysql statement that I just executed?

Hari kanna picture Hari kanna · May 27, 2010 · Viewed 142.8k times · Source

How can I undo the most recently executed mysql query?

Answer

Vimard picture Vimard · May 27, 2010

If you define table type as InnoDB, you can use transactions. You will need set AUTOCOMMIT=0, and after you can issue COMMIT or ROLLBACK at the end of query or session to submit or cancel a transaction.

ROLLBACK -- will undo the changes that you have made