Home > Database > Mysql Tutorial > mysql isolation level

mysql isolation level

王林
Release: 2020-01-30 20:40:58
forward
2864 people have browsed it

mysql isolation level

Transactions and Isolation Levels

The concept of transaction: A transaction treats a series of operations on the database as a whole, or all of them succeed , or all fail. Using transactions, we can ensure the integrity of the database and the transactions are atomic.

Isolation level: The isolation level defines the isolation distance between transactions.

mysql isolation level

Dirty read: A dirty read occurs when a transaction reads uncommitted modifications of another transaction.

(Related video tutorial recommendation: mysql video tutorial)

Nonrepeated read (nonrepeated read): The same query is performed multiple times in the same transaction, due to other transaction submissions The modifications made result in different results returned each time, and non-repeatable reading occurs at this time.

Phantom read: The same query is performed multiple times in the same transaction. Due to the addition or deletion operations made by other transactions or submissions, a different result set is obtained each time. This occurs. Phantom reading.

Non-repeatable reading focuses on modification, while phantom reading focuses on adding or deleting. To solve non-repeatable reads, you only need to lock rows that meet the conditions, and to solve phantom reads, you need to lock the table.

MySQL has four transaction isolation levels

Read uncommitted(Read uncommitted)

Read committed(Read committed)

Repeated read(Repeated read)

Serializable

MySQL default isolation level is: Repeated read(Repeated read)

Related article tutorials Recommended: mysql tutorial

The above is the detailed content of mysql isolation level. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:cnblogs.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template