定时备份mysql数据库bat

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

@echo off
echo.

echo      MySQL Backup   >>F:\xxx\aa.log

echo *****************************
echo.
echo Today is %date%     >>F:\xxx\aa.log
echo Time is %time%      >>F:\xxx\aa.log
echo.
echo *****************************


set "Ymd=%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%"

md "F:\xxx\%Ymd%"

"E:\mysql\MySQL Server 5.6\bin\mysqldump" --opt -Q -u用户名 -p密码 --default-character-set=utf8 实例名> "F:\xxx\%Ymd%\test_bak.sql"  


echo  end     >>F:\xxx\aa.log
echo.