I want to lock everything--completely. Very simple. Just prevent things from changing!! Will this work?
use mydatabase;
flush tables with read lock;
...
unlock tables;
Edit: But, it has to be available for replication.
I want to lock everything--completely. Very simple. Just prevent things from changing!! Will this work?
use mydatabase;
flush tables with read lock;
...
unlock tables;
Edit: But, it has to be available for replication.
This closes all open tables and locks all tables for all databases with a read lock until you execute UNLOCK TABLES.
Wouldn't it be simpler to adjust the security for the user account accessing the database so that it only has read access?