{I+=codeWee;}
[SQL] Backup batch file for MySQL on Windows
ECHO MySQL Start Backup
FOR /F "tokens=1-3 delims=- " %%a IN ('DATE /T') DO (SET dt=%%a-%%b-%%c)
FOR /F "tokens=1-4 delims=:." %%a IN ('ECHO %TIME%') DO (SET tm=%%a%%b%%c%%d)
SET backupfilename=_%dt%_%tm%.sql
ECHO Backup file name: %backupfilename%
mysqldump --routines -u[username] -p[password] [database_name] > C:\BackupData\"dbname%backupfilename%"
ECHO Delete old backup files
FORFILES /P E:\data\backup /S /M *.sql /D -3 /C "cmd /c del @file"
ECHO Finish Backup
HTML | PHP | C++ | DirectX11 | Javascript | C# | HTML5 | ASP | SQL | General | CSS | Oculus Rift | Unity3d | Virtools SDK | Tip | NSIS | PowerShell | node.js | Web API | RTSP | All
Copyright© 2016 CodeWee.com All rights reserved.