mysql查看被锁住的表
- mysql查看被锁住的表 查询是否锁表show OPEN TABLES where In_use > 0;查看所有进程MySQL: show processlist;mariabd: show full processlist;查询到相对应的进程===然后 kill id 杀掉指定mysql连接的进程号kill $pid查看正在锁的事务SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS; 查看等待锁的事务SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCK_WAITS; 查看innodb引擎的运行时信息show engine innodb status\G;查看造成死锁的sql语句,分析索引情况,然后优化sql语句; 查看服务器状态show status like '%lock%';查看超时时间:show variables like '%timeout%';