Set MySQL to Read-Only

For a backup server which we may want to run as read-only for short maintenance periods the following may be useful.
Method 1: Global read_only
Login to MySQL and set the read_only setting to true:

mysql -u root -p
set GLOBAL read_only = true;

To unset this run:

set GLOBAL read_only = false;

Method 2: Read Lock
Another method which will queue queries while the tables are locked and then run them when the tables have been unlocked involves:


To revert back use:


Exchange Offline Address Book Not Updating

Some users where complaining about the Offline Address Book being out-of-date. Checking the Event Viewer on the cluster node which creates the OAB showed the following error:

OALGen detected that the file ‘…..lzx’ is corrupted
or missing. This indicates data tampering or disk problems. Restore
files in this folder from the recent backup or clean up folder content
and force a full OAB generation. – Default Offline Address Book

So I ran:

Get-OfflineAddressBook | fl Name,Server,AddressLists,IsDefault,Guid

This gets the Guid for the Address Book which we use in:

Update-OfflineAddressBook <paste GUID here>

The Event Log showed another error and advised increasing the verbosity of error logs so I ran:

Set-EventLogLevel -id “MSExchangeSA\OAL Generator” -Level expert -verbose

I then ran the Update-OfflineAddressBook command again and this time there were extra information logs in the event log but the updated OAB was created.

Update-OfflineAddressBook <paste GUID here>

I checked that the OAB was being replicated out to the CAS servers.
A great post about Exchange OAB can be found here including a script to check for the staleness of the OAB.