Lock MYSQL tables before exporting tables

  Ensure a consistent snapshot by executing this statement to lock the tables so that they cannot be modified during export: mysql> FLUSH TABLES hr.employees, hr.managers WITH READ LOCK; While the lock is in effect, the tables can still be used, but only for read access. Unlock the tables: mysql> UNLOCK TABLES;

 

  1. Ensure a consistent snapshot by executing this statement to lock the tables so that they cannot be modified during export:

    mysql> FLUSH TABLES hr.employees, hr.managers WITH READ LOCK;

    While the lock is in effect, the tables can still be used, but only for read access.

  2. Unlock the tables:

    mysql> UNLOCK TABLES;
0
Would love your thoughts, please comment.x
()
x