-1

I have a database that already have a lot of changes for weeks and the autocommit has been disabled. Today we restarted mysql service, will those changes be rollbacked? We haven't executed COMMIT for weeks now.

Or will the rollback only applies to the last query?

0

1 Answer 1

2

The commit is scoped to the session. When autocommit is turned off, the transactions are rolled back when you close the session. But you should see the consequences way before you stop MySQL, unless you keep your sessions running for weeks...?

By the way, the autocommit variable is dynamic you can turn on/off when you want for the next sessions.

SET GLOBAL autocommit = 1;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.