Show all current locks from get_lock

braunbaer picture braunbaer · Jun 14, 2012 · Viewed 173.4k times · Source

Is there any way to select / show all current locks that have been taken out using the GET_LOCK function?

Note that GET_LOCK locks are different from table locks, like those acquired with LOCK TABLES - readers who want to know how to see those locks should read Detecting locked tables (locked by LOCK TABLE)

Answer

Marc Alff picture Marc Alff · Apr 30, 2015

Starting with MySQL 5.7, the performance schema exposes all metadata locks, including locks related to the GET_LOCK() function.

See http://dev.mysql.com/doc/refman/5.7/en/metadata-locks-table.html