MYSQL how to unlock table if I used command LOCK table table_name WRITE;

后端 未结 1 650
伪装坚强ぢ
伪装坚强ぢ 2021-01-24 00:38

This is my first question so please bear with me.

I have used this command:

LOCK \"table table_name WRITE;\" 

in mysql workbench to l

相关标签:
1条回答
  • 2021-01-24 00:46

    Rules for Lock Release


    When the table locks held by a session are released, they are all released at the same time. A session can release its locks explicitly, or locks may be released implicitly under certain conditions.

    • A session can release its locks explicitly with UNLOCK TABLES.

    • If a session issues a LOCK TABLES statement to acquire a lock while already holding locks, its existing locks are released implicitly before the new locks are granted.

    • If a session begins a transaction (for example, with START TRANSACTION), an implicit UNLOCK TABLES is performed, which causes existing locks to be released.

    Ref: http://dev.mysql.com/doc/refman/5.7/en/lock-tables.html

    0 讨论(0)
提交回复
热议问题