Search code examples
mysqldatabasetransactionsinnodbisolation-level

How to set transaction isolation level (MySQL)


How do I set the isolation level of MySQL 5.1 InnoDB?

By entering:

mysql> show variables like '%isola%';

The default level set for InnoDB is repeatable read.
How do I change the isolation level?


Solution

  • SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
    

    SESSION is optional, just limits the setting to the current session.
    READ UNCOMMITTED is to be replaced with your desired level.

    https://dev.mysql.com/doc/refman/8.0/en/set-transaction.html