UNLOCK

UNLOCK is an SQL command used to relinquish any lock that is held by the current session on the specified database tables or page. It must be including in a transaction to maintain the database's consistency and integrity. This command allows other transactions to gain access to the previously locked tables.

Example

UNLOCK TABLES;

Output

Query OK, 0 rows affected (0.00 sec)

Explanation

The UNLOCK TABLES SQL command in MySQL is used to release any locks held by the current session on the named tables or databases. In the above example, all table locks are released. If the session currently holds a global read lock or named lock, UNLOCK TABLES will release that as well.

For in-depth explanations and examples SQL keywords where you write your SQL, install our extension.