Updated on 2022-11-18 GMT+08:00

START TRANSACTION

Syntax

START TRANSACTION [ mode [, ...] ]

mode is used to set the transaction isolation level. The options are as follows:

ISOLATION LEVEL { READ UNCOMMITTED | READ COMMITTED | REPEATABLE READ | SERIALIZABLE }

READ { ONLY | WRITE }

Description

This statement is used to start a new transaction in the current session.

Example

START TRANSACTION;
START TRANSACTION ISOLATION LEVEL REPEATABLE READ;
START TRANSACTION READ WRITE;
START TRANSACTION ISOLATION LEVEL READ COMMITTED, READ ONLY;
START TRANSACTION READ WRITE, ISOLATION LEVEL SERIALIZABLE;

Nested transactions are not supported. That is, after a transaction is started, other transactions cannot be started before the transaction is committed.