一.mysql的锁类型 了解Mysql的表级锁 了解Mysql的行级锁 (1) 共享/排它锁(Shared and Exclusive Locks) 共享锁和排他锁是InnoDB引擎实现的标准行级别锁. 拿共享锁是为了让当前事务去读一行数据. 拿排他锁是为了让当前事务去修改或删除某一行数据.. 设置共享锁:select * from user where id = 1 LOCK IN SHARE MODE; 设置排他锁:select * from user where id = 1 FOR UP…