We currently have a DOS batch script that performs a MySQL dump on the entire database in a single file. What I would like to do is breakup the database by tables, so that within each 'date' folder, there would be a 'db' folder containing individual table dumps. This allows us to restore selected tables rather than restoring an entire db.
@echo off
md C:\backups\%DATE:~-4%-%DATE:~4,2%-%DATE:~7,2%
cd C:\Program Files\MySQL\MySQL Workbench 5.2 CE\
mysqldump -h -u -p --databases db0 > c:\backups\%DATE:~-4%-%DATE:~4,2%-%DATE:~7,2%\db0.sql
mysqldump -h -u -p --databases db1 > c:\backups\%DATE:~-4%-%DATE:~4,2%-%DATE:~7,2%\db1.sql
I found a possible solution using shell: https://stackoverflow.com/a/134296/679449
This appears that it would allow me to export into individual tables, however I'm not sure how to/if it's possible to write in batch. Any help with that is appreciated.