本文介绍了显示来自get_lock的所有当前锁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用 GET_LOCK函数?

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

请注意,GET_LOCK锁与表锁不同,例如通过LOCK TABLES获取的锁-想知道如何查看那些锁的读者应阅读

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)

推荐答案

从MySQL 5.7开始,性能模式公开了所有元数据锁,包括与GET_LOCK()函数相关的锁.

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

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

这篇关于显示来自get_lock的所有当前锁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 22:55