The syntax is as follows:
mysql> LOCK TABLES table_name [READ | WRITE]
To unlock the tables, use:
mysql> UNLOCK TABLES;
To lock all tables across all databases, execute the following statement. It is used when taking a consistent snapshot of the database. It freezes all writes to the database:
mysql> FLUSH TABLES WITH READ LOCK;