Home > Database > Mysql Tutorial > How to query the transaction isolation level in mysql

How to query the transaction isolation level in mysql

青灯夜游
Release: 2022-02-17 17:37:15
Original
22339 people have browsed it

Mysql method to query the transaction isolation level: 1. Start the command line window and connect to the MySQL database; 2. Execute the "show variables like 'tx_isolation';" or "SELECT @@tx_isolation;" command in the command window You can check it.

How to query the transaction isolation level in mysql

The operating environment of this tutorial: windows7 system, mysql8 version, Dell G3 computer.

SQL standard supports 4 transaction isolation levels, READ_UNCOMMITTED (read uncommitted), READ_COMMITTED (read committed), REPEATABLE_READ (repeatable read), SERIALIZABLE (serial read), MySQL innodb engine supports all of these There are 4 types of transaction isolation levels. This article will share how to check the transaction isolation level in MySQL.

Mysql steps to query transaction isolation level

1. Start the command line window and connect to the MySQL database

Illustration, connect to the MySQL database through the client command mysql provided by MySQL.

How to query the transaction isolation level in mysql

#2. Query the current transaction isolation level of the database through system variables

Illustration, query the system variables provided by the database ## The current transaction isolation level can be obtained by using the value of #tx_isolation or transaction_isolation.

The default transaction isolation level of MySQL database is REPEATABLE_READ (repeatable read).

Grammar format one:


show variables like 'tx_isolation';
show variables like 'transaction_isolation';
Copy after login

How to query the transaction isolation level in mysql

Grammar format two:

SELECT @@tx_isolation;
SELECT @@transaction_isolation;
Copy after login

How to query the transaction isolation level in mysql

【 Related recommendations:

mysql video tutorial

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

source:php.cn
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