@echo off
--关闭回显
set "Ymd=%date:~,4%%date:~5,2%%date:~8,2%"
cd C:\Program Files\MySQL\MySQL Server 5.5\bin
--切换到mysql运行目录下
mysqldump -uroot -pXXX密码XXX 数据库名 > D:\backup\备份文件名_%Ymd%.bak
--备份数据库
@echo on
转载于:https://blog.51cto.com/throbbing/1384639