查看默认的事务隔离级别 mysql默认是的可重复读 repeatable read
select @@transaction_isolation;
设置事务的隔离级别:不同级别处理事务的效率不同 (一般不用mysql语句来设置,用框架来设置)
set session transaction isolation level read uncommitted; --读未提交
set session transaction isolation level read committed; --不可重复读
set session transaction isolation level repeatabe read; --可重复读
set session transaction isolation level serializable; --串行化
以上四种从上到下隔离级别从低到高,级别越低,越能支持高并发的数据库操作,同时也会带来较高的并发风险
标签:session,事务,transaction,隔离,read,isolation,set,级别 From: https://www.cnblogs.com/xlm926/p/17444206.html