一、存储引擎
- MyISAM:做查询,无事务
- InnoDB:支持事务
二、事务开启
show variables like 'autocommit';
--不开启用'off'
--执行时,
begin;
xxxxxx;
commit/rollback;
三、事务隔离问题
```sql —共享锁 select from table lock in share mode; —排他锁 delete/insert/update 自动加锁 select from table for update; —意向共享锁 —意向排他锁 检测表是否可以获取到锁。若可获取,可进一步 对数据加锁