mysql_自动备份

 1 @echo off
 2 set errorlevel=0 
 3 set dump_command="C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqldump"
 4 set db_name=test_db 
 5 set backup_dir=D:\back\
 6 set timestamp=%date:~,4%%date:~5,2%%date:~8,2%
 7 set backup_jira_file="%backup_dir%%db_name%_backup_%timestamp%.sql"
 8 set user_mysql=root 
 9 set password_mysql=root
10 echo backup mysql database:%db_name% 
11 %dump_command% --no-defaults -u%user_mysql% -p%password_mysql% %db_name% > %backup_jira_file%
12 echo end backup
13 pause;

通过定制任务 ,每天启动  ,删除文件 可以借鉴 另外一篇博客  oralce_自动备份

posted @ 2013-10-10 17:34  cphmvp  阅读(200)  评论(0编辑  收藏  举报
爬虫在线测试小工具: http://tool.haoshuju.cn/