Tips & Tricks
Locking Database
How to make a MySQL server read only to all users?
mysql -u root --password=$MYSQL_ROOT_PASSWORD -e "SET GLOBAL super_read_only = ON;mysql -u root --password=$MYSQL_ROOT_PASSWORD -e "SET GLOBAL super_read_only = OFF;How to make a MySQL server read only to all user except the super user?
mysql -u root --password=$MYSQL_ROOT_PASSWORD -e "SET GLOBAL read_only = ON;mysql -u root --password=$MYSQL_ROOT_PASSWORD -e "SET GLOBAL read_only = OFF;How to lock all tables?
FLUSH TABLES WITH READ LOCK;
// do work here
UNLOCK TABLES;How to lock a single table table?
Last updated