2
1
I've got a MySQL database on a server running Windows 7, and I want to create a quick (but safe!) copy without shutting anything down. I issue FLUSH TABLES WITH READ LOCK, run Robocopy, then issue UNLOCK TABLES. Here's the issue: If I use the /B option to Robocopy, it prints a lot of messages saying "The process cannot access the file because it is being used by another process.", and only copies 209 of the 535 files in MySql data directory. If I leave off the /B option, Robocopy reports that all files are copied. But now I'm unsure. I'm guessing that MySQL leaves the table files open even while things are locked, and Robocopy/B decides that backing them up would be unsafe. Without /B, Robocopy makes its best effort, which should work because MySQL isn't doing any I/O, but I'd like to opinion of someone wiser than I. Thanks!
Unless you have a good reason not to, you really should be using mysqldump to properly backup mysql databases. – Zoredache – 2015-09-04T21:58:50.973