mysql等待_查询MySQL锁等待的语句select
'Blocker' role,
p.id,
p.user,
left(p.host, locate(':', p.host) - 1) host,
<_id,
<_state,
<_started,
简单的mysql语句timestampdiff(second, tx.trx_started, now()) duration,
lo.lock_mode,
lo.lock_type,
lo.lock_table,
lo.lock_index,
<_query,
<_tables_in_use,
<_tables_locked,
<_rows_locked
from
information_schema.innodb_trx tx,
information_schema.innodb_lock_waits lw,
information_schema.innodb_locks lo,
information_schema.processlist p
where
lw.blocking_trx_id = tx.trx_id
and p.id = tx.trx_mysql_thread_id
and lo.lock_trx_id = tx.trx_id
union all
select
'Blockee' role,
p.id,
p.user,
left(p.host, locate(':', p.host) - 1) host,
<_id,
<_state,
<_started,
timestampdiff(second, tx.trx_started, now()) duration, lo.lock_mode,
lo.lock_type,
lo.lock_table,
lo.lock_index,
<_query,
<_tables_in_use,
<_tables_locked,
<_rows_locked
from
information_schema.innodb_trx tx,
information_schema.innodb_lock_waits lw,
information_schema.innodb_locks lo,
information_schema.processlist p
where
and p.id = tx.trx_mysql_thread_id
and lo.lock_trx_id = tx.trx_id \G

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。