LOCK TABLES and UNLOCK TABLES Statements “FLUSH Statement” . (This is a very convenient way to get backups if you have a file system such as Veritas that can take snapshots in time.) A table lock protects only against inappropriate reads or writes by other sessions. A session holding a WRITE  lock can perform table-level operations such as  DROP TABLE  or  TRUNCATE TABLE . For sessions holding a  READ  lock,  DROP TABLE  and  TRUNCATE TABLE  operations are not permitted. The following discussion applies only to non- TEMPORARY  tables.  LOCK TABLES  is permitted (but ignored) for a  TEMPORARY  table. The table can be accessed freely by the session within which it was created, regardless of what other locking may be in effect. No lock is necessary because no other session can see the table. To acquire table locks within the current session, use the  LOCK TABLES  statement, which acquires metadata locks (see Section 8.11.4, “Metadata Locking” ). The following lock types are available: READ [LOCAL]  lock: WRITE  locks normally have higher priority than  READ  locks to ensure that updates are processed as soon as possible. This means that if one session obtains a  READ  lock and then another session requests 2727 •The  LOW_PRIORITY  modifier has no effect. In previous versions of MySQL, it affected locking behavior, but this is no longer true. It is now deprecated and its use produces a warning. Use  WRITE  without LOW_PRIORITY  instead. •Lock requests for the table by other sessions block while the  WRITE  lock is held. •Only the session that holds the lock can access the table. No other session can access it until the lock is released. •The session that holds the lock can read and write the table. [LOW_PRIORITY] WRITE  lock: •The  LOCAL  modifier enables nonconflicting  INSERT  statements (concurrent inserts) by other sessions to execute while the lock is held. (See Section 8.11.3, “Concurrent Inserts” .) However,  READ LOCAL cannot be used if you are going to manipulate the database using processes external to the server while you hold the lock. For  InnoDB  tables,  READ LOCAL  is the same as  READ . •Other sessions can read the table without explicitly acquiring a  READ  lock. •Multiple sessions can acquire a  READ  lock for the table at the same time. •The session that holds the lock can read the table (but not write it). •Table-Locking Restrictions and Conditions •LOCK TABLES and Triggers •Interaction of Table Locking and Transactions •Table Lock Release •Table Lock Acquisition Table Lock Acquisition