一个默认的mysql导出脚本:
@echo off
echo.
echo MySQL数据库备份
echo *****************************
echo.
echo 今天是 %date%
echo 时间是 %time%
echo.
echo *****************************
set "Ymd=%date:~,4%%date:~5,2%%date:~8,2%"
md "D:\myoa\mysql_data_back\%Ymd%"
set bakFileNameTail=_BAK_%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%
D:\myoa\mysql5\bin\mysqldump -uroot -pmyoa888 td_oa> D:\myoa\mysql_data_back\%Ymd%\%bakFileNameTail%.sql
echo.:P
echo MySQL数据库备份完成,请进行检查。。。
echo.:P
echo.
//pause
完整的导出命令行:
mysqldump -hlocalhost -P3336 -uroot -pmyoa888 --default-character-set=gb2312 td_oa>td_oa.sql