MySQL查看锁及事务隔离级别的命令

1、查看锁表状态
SHOW PROCESSLIST;

2、查看锁表状态
SELECT *
FROM information_schema.innodb_trx
ORDER BY trx_started

3、生成批量杀除锁表进程语句 Kill 进程id
SELECT concat(‘KILL ‘,id,’;’) FROM information_schema.processlist WHERE user=’jdlottery’

4、查看锁表等待时间
show variables like ‘innodb_lock_wait_timeout’;

5、设置锁表等待时间
set innodb_lock_wait_timeout=100

6、查看事务隔离级别及设置
select @@global.tx_isolation;
select @@tx_isolation;
set tx_isolation=’READ-UNCOMMITTED’;

7、开始事务/提交事务
start transaction;
commit;

你可能感兴趣的:(技术实践)