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