mysql 备份数据语句

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 数据库名

你可能感兴趣的:(mysql 备份数据语句)