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

How to query the transaction isolation level in mysql

青灯夜游
青灯夜游Original
2022-02-17 17:37:1522253browse

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';

How to query the transaction isolation level in mysql

Grammar format two:

SELECT @@tx_isolation;
SELECT @@transaction_isolation;

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!

Statement:
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