@echo off
echo.
echo MySQL数据库备份
echo *****************************
echo.
echo 今天是 %date%
echo 时间是 %time%
echo.
echo *****************************
set "Ymd=%date:~,4%%date:~5,2%%date:~8,2%"
md "D:\JDBC\%Ymd%"
"C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqldump" --opt -Q -uroot -pabc123 --default-character-set=latin1 test > "D:\JDBC\%Ymd%\test_bak.sql"
echo.
echo MySQL数据库备份完成,请进行检查。。。
echo.
echo.
pause
来源:oschina
链接:https://my.oschina.net/u/567296/blog/295518