Mysql事务隔离级别查询与设置

1.查询

SELECT @@global.tx_isolation;

SELECT @@session.tx_isolation;

SELECT @@tx_isolation;

2.设置为读已提交

SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;

SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;

3.设置为可重复读

SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;

SET  GLOBAL TRANSACTION ISOLATION LEVEL  REPEATABLE READ;

你可能感兴趣的:(Mysql事务隔离级别查询与设置)