Lock MYSQL tables before exporting 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;

Leave a Comment

Your email address will not be published. Required fields are marked *

Shopping Cart
Scroll to Top