I can successfully execute "FLUSH TABLES myTable FOR EXPORT;" in MySql Workbench. Then I can copy the cfg and ibd files I need, and then I can go back to workbench and run "UNLOCK TABLES" and all is well. But I would like to do this from a Windows batch file. However, if I run the following bat file:
mysql -username u -password < prepareTableForCopy.txt
and prepareTableForCopy.txt contains the following:
use mydata; FLUSH TABLES myTable FOR EXPORT;
I get no errors, but when I look in the data folder the files I need to copy are not there. It seems that as soon as the flush is run and the script returns the files are gone.
How can I fix this so that I can achieve my goal which is to have a .bat file that prepares the table for export, copied the correct files to another directory. zips the files and then unlocks the table?