mysql 查看表锁情况

/*
查看正在运行的进程
*/
show full processlist;

/*
查看表打开情况
In_use:表示表锁或锁请求数;
Name_locked:表示表名是否被锁;
*/
show open tables where in_use >0 or name_locked >0;

/*
查看服务器锁状态
*/
show GLOBAL status like '%lock%';

/*
查看服务器配置参数
*/
show variables like '%timeout%';

参考:

https://dev.mysql.com/doc/refman/8.0/en/show-processlist.html