Transaction
START TRANSACTION;
SAVEPOINT save1;
ROLLBACK TO save1;
ROLLBACK;
COMMIT;

You cannot roll back CREATE or DROP operations.

After a COMMIT or ROLLBACK statement has been executed, the transaction is automatically closed, and future changes will implicitly commit.

Savepoints are automatically released after the transaction complete.

Instruct MySQL to not automatically commit changes until the flag is set back to true:

SET autocommit=0;
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License