@lyxiang
        
        2019-07-08T03:42:56.000000Z
        字数 1150
        阅读 754
    未分类
| 表锁 | 行锁 | 页锁 | 
|---|---|---|
| MyISAM | 支持 | 不支持 | 
| BDB | 支持 | 支持 | 
| InnoDB | 支持 | 支持 | 
//对数据对象A加上S锁start transaction;select * from yitiao_user_coupon where id = 90 LOCK IN SHARE MODE; //commit之后,就会释放S锁//在看一个事务,去更新数据对象Astart transaction;update yitiao_user_coupon set coupon_id = 9 where id = 90; //等待锁//查看锁sqlselect * from information_schema.processlist where COMMAND = 'Query' and db = 'xxx';//杀死锁kill id
//对数据对象A加上S锁start transaction;select * from yitiao_user_coupon where id = 90 for update; //commit之后,就会释放S锁//在看一个事务,去更新数据对象Astart transaction;select * from yitiao_user_coupon where id = 90 LOCK IN SHARE MODE; //等待锁//查看锁sqlselect * from information_schema.processlist where COMMAND = 'Query' and db = 'xxx';//杀死锁kill id