首先我们通过命令:select @@tx_isolation; 来查看当前数据库的隔离级别
Mysql默认的隔离级别为REPEATABLE-READ(不可重复读)。
设置隔离级别的命令为:set session transaction isolation level + 隔离级别
设置隔离级别为读取未提交:set session transaction isolation level read uncommitted;
设置隔离级别为读取已提交: set session transaction isolation level read committed;
设置隔离级别为可重复读:set session transaction isolation level repeatable read;
设置隔离级别为串行化:set session transaction isolation level serializable;