乐趣区

关于mysql:Mysql-隔离级别详解

脏读: 事务 A 读到了事务 B 已更新但未提交的数据;

事务 A 事务 B
SET autocommit = 0; SET autocommit = 0;
select money From test where id=1;Res: 100 select money From test where id=1;Res: 100
update test set money=666 where id=1;Res: Query OK, 1 row affected (0.00 sec)
select money From test where id=1;
Res: 666 commit; Query OK, 0 rows affected (0.00 sec)
退出移动版