windows Mysql备份脚本

 bat不怎么会啊,研究好久才写了个能用的。

echo off
set BAK_Dir=F:\share\JavaServer\224DB_BackUP
 ::yyyy-MM-dd-hhmmss
for /f "tokens=1-4 delims=/:. " %%i in ("%date:~0,10%-%time%") do (
set ymd=%%i%%j%%k%%l
)

if not exist %BAK_Dir% md %BAK_Dir% cd /d C:\Program Files\MySQL\MySQL Server 5.5\bin\ mysqldump.exe -hlocalhost -uroot -proot --default-character-set=utf8 dbName>>%BAK_Dir%\%ymd%_dbName.sql pause

 

posted @ 2012-10-31 17:34  为啥  Views(147)  Comments(0Edit  收藏  举报