Take the 2-minute tour ×

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?

share|improve this question
It appears that you've listed a number of workable solutions right there in your question. –  tylerl Nov 29 '10 at 20:34
add comment

1 Answer

up vote 2 down vote accepted

As the MySQL instruction "system " or "! " only works under linux your stuck with stoppig your service, take your vss snapshot and start the service.

The system command would allow to take the vss snapshot from within mysql so you don't lose locks. I believe it is used for LVM Snapshot backup.

share|improve this answer
add comment

Your Answer


