UNLOCK TABLES

Use this MySQL statement to unlock tables that were locked by the current connection thread with the LOCK TABLES statement.

Syntax

Below is the syntax for this command. Text within square brackets (i.e, [ and ] ) are optional. Choices are separated by bars (i.e, | ). Ellipses preceded by a comma indicates a repeating pattern. Ellipses before or after syntax are used to highlight a relevant except from the larger syntax. Text displayed in italic letters represent text that should be replaced with the specific names related to the database (e.g., column with the name of the column).

UNLOCK TABLES

Explanation

Use this statement to unlock tables that were locked by the current connection thread with the MySQL statement LOCK TABLES or by FLUSH TABLES WITH READ LOCK. UNLOCK TABLES implicitly commits any active transactions if any tables were locked with LOCK TABLES. When performing a large amount of changes to data in MyISAM tables, it can be useful and faster to lock the tables first. This way the key cache isn't flushed after each SQL statement. Instead, the server flushes the key cache when executing UNLOCK TABLES.