Last answered:

09 Nov 2022

Posted on:

25 Apr 2022


Resolved: COMMIT and ROLLBACK apparently not working


When I run the ROLLBACK command it does not seem to work. I have disabled the safe update option, and have been running the code alongside the lessons. However, my rollbacks are not working, even in the previous lesson.

/* DELETE statement ---
DELETE FROM table_name
WHERE conditions;
USE employees;


FROM employees
WHERE emp_no = 999903;

DELETE FROM employees
emp_no = 999903;

FROM titles
WHERE emp_no = 999903;


3 answers ( 1 marked as helpful)
Posted on:

27 May 2022


Hi João!
Thanks for reaching out.

There are very few reasons that could lead to this problem. We believe there is a setting that, for some reason, has been switched on or off, and that’s what causes the issue here.

In the SQL editor of MySQL Workbench, there is the possibility to toggle the autocommit mode by pressing a single button. This is the third of the three icons seen in the red rectangle. If you’ve pressed this button, it means that this mode will be turned on, and each statement will be committed immediately.

Please check if it has been left intact and you can see the three icons within the red rectangle in color, just as it is shown in the picture above.

(When the button has been pressed, the autocommit mode will be toggled on, and the tick and the X button will probably appear grey.

If this is the case, please toggle off the autocommit button by pressing the third of the icons to see the tick
and the X button in blue again.)

Hope this helps.

Posted on:

18 Oct 2022


An alternative to the answer above I found useful is to execute

SET autocommit = 0;

Posted on:

09 Nov 2022


helpful answer.
solve my problem.

Submit an answer