- 论坛徽章:
- 39
|
@echo off
@config
SET bkupdir=C:\MySql_Back\
SET mysqldir=C:\Program Files\MySQL\MySQL Server 5.0\
SET dbname=mysql
SET dbuser=root
SET dbpassword=123456
SET CharacterSet=gb2312
SET host=127.0.0.1
@echo bk_name ...
for /f "eol= tokens=1,2,3 delims=-, " %%i in ('date /t') do set yy=%%i& set mm=%%j& set dd=%%k
for /f "eol= tokens=1,2 delims=:, " %%i in ('time /t') do set hour=%%i& set minute=%%j
set bk_name=%yy%_%mm%_%dd%_%hour%_%minute%
@echo Beginning backup ...
"%mysqldir%bin"\mysqldump -h%host% -u%dbuser% -p%dbpassword% %dbname% --default_character-set=%CharacterSet% --opt >%bkupdir%dbBkup_%bk_name%_03.sql
修改@config 这段就可以了 |
|