- show processlist;
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~
- SELECT
- (@i:= @i+1) as 'key',
- c.id
- FROM
- company c,
- (SELECT @i:=0) as i
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~
- select * from information_schema.INNODB_TRX; -- 当前运行的所有事务
-
- select * from information_schema.INNODB_LOCKS; -- 当前出现的锁,查看正在锁的事务
-
- select * from information_schema.INNODB_LOCK_WAITS; -- 锁等待的对应关系,查看等待锁的事务
-
- select * from tab-name for update; -- 锁表