Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

readme.md

Starting a Transaction

To start a transaction in MySQL, you can use either START TRANSACTION, BEGIN, or BEGIN WORK statement.

Example:

START TRANSACTION;
-- or
BEGIN;
-- or
BEGIN WORK;

Committing a Transaction

Committing a transaction in MySQL saves all changes made within the transaction to the database. Use the COMMIT statement to commit a transaction.

Example:

COMMIT;

Rolling Back a Transaction

If an error occurs or if you need to discard the changes made within a transaction, you can roll back the transaction using the ROLLBACK statement.

Example:

ROLLBACK;
prev next