Archive for January, 2013

Check if / Make a MySQL instance read only

January 8, 2013

To check if A DB is already in read only mode:

SELECT @@global.read_only;

To set ( at Runtime)

SET GLOBAL read_only=1;

To set permanently,  add the following in my.cnf

“read_only”

These options will  make the DB run  in a read only mode, except for the slave threads and the super users, who can still do writes.  This is used on slaves when you want to make sure only read requests are executed on slaves.

Advertisements