rem ******MySQL backup start********
@echo off
forfiles /p "D:\website\备份\数据库日常备份" /m backup_*.sql -d -30 /c "cmd /c del /f @path"
set "Ymd=%date:~0,4%%date:~5,2%%date:~8,2%0%time:~1,1%%time:~3,2%%time:~6,2%"
"C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqldump" -uroot -pEd987654 "database name" > "D:\website\备份\数据库日常备份\backup_%Ymd%.sql"
@echo on
rem ******MySQL backup end********
红色部分换掉即可。1跟4 一样,请提前建好文件夹
2 就是mysqldump.exe文件所在位置
3 数据库名
原文地址:https://www.cnblogs.com/wdw31210/p/9838068.html
时间: 2024-10-30 06:12:23