dotnetic Posted January 12, 2020 Share Posted January 12, 2020 Hey guys I wanted to share this little snippet with you, which can be run as a .bat file, and backups all of your databases into a separate file: K:\laragon\bin\mysql\mysql-5.7.19-winx64\bin\mysql.exe -uroot -s -N -e "SHOW DATABASES" | for /F "usebackq" %%D in (`findstr /V "information_schema performance_schema"`) do K:\laragon\bin\mysql\mysql-5.7.19-winx64\bin\mysqldump.exe %%D -uroot > P:\htdocs\database-backups\%%D.sql of course you have to change the paths to your mysql/mysqldump.exe files and the destination directory, and the username, if you have to provide another than root. This task can be executed daily via task scheduling in Windows. 3 Link to comment Share on other sites More sharing options...
dragan Posted January 12, 2020 Share Posted January 12, 2020 Thanks for sharing. ? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now