MySQL autocommit

xiaoxiao2021-02-28  99

set autocommit=0

set autocommit=0; update tba set name=1 where id=1; update tbb set name=2 where id=1; commit; set autocommit=1;

commit以上的sql相当于一个事务,在不commit时,其他会话时看不到结果,如果此时其他会话更新相同的数据,会堵塞等待。

转载请注明原文地址: https://www.6miu.com/read-36977.html

最新回复(0)