How to dump all databases in multiple files

written by Admin

Posted on 2014-10-06


I want to dump in a folder all my databases: a file for each db.


Run this script:
cd "C:\Program Files\MySQL5\MySQL Server 5.6\bin"

mysql.exe -uUSER -pPASS -s -N -e "SHOW DATABASES" | for /F "usebackq" %%D in (`findstr /V "information_schema performance_schema"`) do mysqldump %%D -uUSER -pPASS > C:\backup\dump\%%D.sql
Put in USER the username of a database user that can access (SELECT permission) each database and put in PASS the password (without spaces).

Don´t forget to customize file-names, folder-names and the path of mysqldump.



Leave a Comment:



We need collaboration and a real boost from our community: write us an email for every trick you find!

This website is a sysadmin swiss-knife for every-day Windows, Linux and Mac administration and troubleshooting

Our database grows if YOU send us your tips and trick as soon as you find them every day!