Lock database
==============
FLUSH TABLES WITH READ LOCK;
lock all the tables of a single database or to lock a particular table
lock tables db.* read;
UNLOCK TABLES;
FLUSH TABLES WITH READ LOCK; do not quit the mysql shell else you will lose the lock
LOCK TABLES t1 WRITE, t2 READ;
LOCK TABLES explicitly acquires table locks for the current client session. Table locks can be acquired for base tables or (as of MySQL 5.0.6) views. You must have the LOCK TABLES privilege, and the SELECT privilege for …