Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- cls
- set dbUser=xxx
- set dbPassword=xxx
- set backupDir=C:BackupMySQL%date:~0,2%%time:~0,2%
- set file=xxx.sql
- set mysqldump="C:wamp64binmysqlmysql5.7.14binmysqldump.exe"
- set zip="C:Program Files7-Zip7z.exe"
- if not exist "%backupDir%" (
- mkdir "%backupDir%"
- )
- %mysqldump% --host="xxx" --user=%dbUser% --password=%dbPassword% xxx > "%backupDir%%file%"
- %zip% a -tgzip "%backupDir%%file%.gz" "%backupDir%%file%"
- del "%backupDir%%file%"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement