Trying to create a batch (cmd) file for backing up each database into a separate file. Databases are created/deleted often, so batch file needs to grab current db names everytime it runs and backup each one of them.
Here is how I want it to be:
mysql -e "show databases" -u root --password=1234
mysqldump %dbname% -u root --password=1234 > S:\Backup\MySQL\%dbname%.sql
Is it possible to do in a batch file?
Please help. Thanks.
You are going to love this one
Have the information_schema database construct a DOS Batch File to perform the mysqldumps in parallel
Just run like any DOS Batch File
Make sure you have the correct username and password to connect to mysql
I just tried it out to make sure
I've tried the answers but none of them worked as expected, here is my solution for backup but it will create a single file for mysql and other user databases.