denrepo

MySQLBlocking & locks

InnoDB lock waits

Uses the sys schema (5.7 and 8.0). sql_kill_blocking_query gives you the ready-made statement to stop the blocker.

Not yet verified. How scripts are tested

b-my-locks.sql
1SELECT wait_age, locked_table, locked_type,2       waiting_pid, waiting_query,3       blocking_pid, blocking_query,4       sql_kill_blocking_query5FROM sys.innodb_lock_waits6ORDER BY wait_age_secs DESC;

Paste it into your query tool.

Open in denrepo