Name
UNLOCK TABLES
Synopsis
UNLOCK TABLES
Use this statement to unlock tables that were locked by the
current connection thread with the LOCK TABLES
statement 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
. Here is an example:
UNLOCK TABLES;
Get MySQL in a Nutshell, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.