One of my clients is running MySQL on a Windows Server 2008 system. Their regular backups are performed using StorageCraft's ShadowCopy, which uses the VSS service to perform backups of open files.
Some investigation indicates that MySQL is not entirely VSS-aware, and that the tables need to be locked prior to the shadow operation, then unlocked afterwards. There is a post at http://forum.storagecraft.com/Community/forums/p/548/2702.aspx which indicates the steps that need to be performed, however the user had some difficulty in performing them and no follow up solution was ever posted. Specifically, they succeeded in writing a batch file to lock the database, however once the batch file returns from MySQL it drops the connection and thus relinquishes the lock.
I'm looking for a method that I can send the MySQL command
FLUSH TABLES WITH READ LOCK, then perform the backup, then send
UNLOCK TABLES when the backup is complete.
Alternatively, I can exclude the MySQL data storage folder from backup, and schedule a
mysqldump backup into a folder that will then be backed up by VSS.
Can I have some recommendations please?