Created
March 10, 2017 16:54
-
-
Save exeleon/c0020c4a07b8d87240bdaf91e7e6b582 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
set /p=Press ENTER to start the backup... | |
set dbName=DBNAME | |
set dbUser=DBUSER | |
set dbPassword=BDPASS | |
set backupDir="C:\backups" | |
set mysqldump="C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqldump.exe" | |
for /F "usebackq tokens=1,2,3 delims=-" %%I IN (`echo %date%`) do echo "%%I" "%%J" "%%K" | |
set date=%date:/=_% | |
%mysqldump% --host="localhost" --user=%dbUser% --password=%dbPassword% --single-transaction --add-drop-table --routines --databases %dbName% > %backupDir%\%dbName%_%date%.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment