This article brings you an introduction to the four transaction isolation levels of the MySQL database. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.
Familiar with the four transaction isolation levels of mysql database:
(Related recommendations: MySQL tutorial)
Query the transaction isolation level in mysql
SELECT @@tx_isolation;
read uncommitted (RU) read uncommitted:
In one transaction, you can read uncommitted changes of other transactions
read committed ( RC) read committed:
In one transaction, you can read changes that have been committed by other transactions
repetable read, (RR) repeatable read:
a transaction , until the end of the transaction, you can repeatedly read the data seen at the beginning of the transaction without changing
The default isolation level of mysql is RR
The difference between RR and RC is that RR isolation is used in a transaction The data read from a table is the same at all levels
Transaction A | Transaction B |
---|---|
begin; select * from a |
|
Under the RC isolation level: the second select query of transaction A can see the data inserted in transaction B
The above is the detailed content of Introduction to the four transaction isolation levels of mysql database. For more information, please follow other related articles on the PHP Chinese website!