日期:2014-05-16 浏览次数:20632 次
@ECHO OFF for /f "tokens=1-4 delims=- " %%a in ('date/t') do ( set yy=%%a set mm=%%b set dd=%%c set dw=%%d ) echo %dw% echo %mm% echo %dd% echo %yy% SET backupdir=F:\bak\mysql SET mysqldir="C:\Program Files\MySQL\MySQL Server 5.1" SET dbname=test SET dbuser=root SET dbpasswd=123456 SET filename=%dbname%_%yy%-%mm%-%dd%.sql @ECHO Beginning backup of %dbname%... %mysqldir%\bin\mysqldump -u %dbuser% -p%dbpasswd% --default-character-set=gbk %dbname% > %backupdir%\%filename% @ECHO Done!