MySQL Transactions and Locking Cheatsheet/Set transaction isolation level

Control read consistency and concurrency behavior.

Section: locking and concurrency

Set transaction isolation level

sql
sql
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
Explanation

Isolation level affects phenomena such as dirty reads, nonrepeatable reads, and phantoms.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing locking and concurrency
Lock selected rows for update
Prevent concurrent modifications to matched rows inside a transaction.
OpenIn sheetsqlsame section
Lock rows for shared reads
Read rows while protecting against conflicting writes.
OpenIn sheetsqlsame section
Inspect InnoDB lock and transaction state
Display detailed InnoDB diagnostics.
OpenIn sheetsqlsame section
Set lock wait timeout for the session
Avoid waiting too long on blocked locks.
OpenIn sheetsqlsame section
Start a transaction
Begin a transaction explicitly.
OpenIn sheetsql1 tag match
Commit a transaction
Persist all changes made in the current transaction.
OpenIn sheetsql1 tag match