MySQL8修改事务隔离级别

一、全局生效

set global TRANSACTION ISOLATION level read COMMITTED;
show global variables like 'transaction_isolation';

 

二、当前会话生效

set  session TRANSACTION ISOLATION level read COMMITTED;
show  variables like 'transaction_isolation';

三、默认隔离级别

repeatable read

四、事务隔离级别

//设置read uncommitted级别:
set  [ global | session ] transaction isolation level read uncommitted;

//设置read committed级别:
set  [ global | session ]  transaction isolation level read committed;

//设置repeatable read级别:
set  [ global | session ] transaction isolation level repeatable read;

//设置serializable级别:
set  [ global | session ] transaction isolation level serializable;

 



posted @ 2021-04-06 18:13  b̶i̶n̶g̶.̶  阅读(954)  评论(0编辑  收藏  举报