Mysql 查看表锁SQL
SELECT
pr.id,
pr.user,
pr.host,
pr.db,
pr.command,
pr.time,
inn.trx_state,
inn.trx_started,
pr.info,
tt.id,
tt.user,
tt.host,
tt.command,
tt.time,
tt.trx_state,
tt.trx_started,
tt.info
FROM
information_schema.processlist pr,
information_schema.innodb_trx inn,
(SELECT
p.id,
p.user,
p.host,
p.db,
p.command,
p.time,
i.trx_state,
i.trx_started,
p.info,
l.blocking_trx_id
FROM
information_schema.processlist p,
information_schema.innodb_trx i,
information_schema.innodb_lock_waits l
WHERE p.id = i.trx_mysql_thread_id
AND i.trx_id = l.requesting_trx_id) tt
WHERE pr.id = inn.trx_mysql_thread_id
AND inn.trx_id = tt.blocking_trx_id;
感谢DBA