@echo off
set "Ymd=%date:~,4%%date:~5,2%%date:~8,2%"
c:
cd C:\MySQL\bin\
mysqldump -h 172.25.66.80 -u root -p1234567 TestDB > D:\db_backup\TestDB_%Ymd%.sql
@echo on
注意当前计算机日期的格式,尽量使2000-01-01格式,不要包含”/“
@echo off
set "Ymd=%date:~,4%%date:~5,2%%date:~8,2%"
c:
cd C:\MySQL\bin\
mysqldump -h 172.25.66.80 -u root -p1234567 TestDB > D:\db_backup\TestDB_%Ymd%.sql
@echo on
注意当前计算机日期的格式,尽量使2000-01-01格式,不要包含”/“