白云岛资源网 Design By www.pvray.com
@echo off
set txt1=%date:~0,4%
::当前年
set txt2=%date:~5,2%
::当前月
set txt3=%date:~8,2%
::当前日
set txt4=%time:~0,2%
::当前小时
set txt5=%time:~3,2%
::当前分钟
set txt6=%time:~6,2%
::当前秒
set date=%txt1%%txt2%%txt3%
set time=%txt4%%txt5%%txt6%
echo --------------------------------------------------
echo -------------正在执行MySQL数据库备份--------------
echo --------------------------------------------------
echo ...
echo ...
echo 导出Database...
if exist %date%.sql del %date%.sql
c:\Progr*\mysql\bin\mysqldump --add-drop-table -c -u root -p-h localhost dbname >e:\%date%.sql
echo ...
echo ...
if exist dump%date%.7z del dump%date%.7z
echo 压缩文件...
7za.exe a -t7z dump%date%.7z %date%.sql -mx9
echo ...
echo ...
echo 删除临时文件
del %date%.sql
echo ...
echo ...
echo 备份完成!
pause
set txt1=%date:~0,4%
::当前年
set txt2=%date:~5,2%
::当前月
set txt3=%date:~8,2%
::当前日
set txt4=%time:~0,2%
::当前小时
set txt5=%time:~3,2%
::当前分钟
set txt6=%time:~6,2%
::当前秒
set date=%txt1%%txt2%%txt3%
set time=%txt4%%txt5%%txt6%
echo --------------------------------------------------
echo -------------正在执行MySQL数据库备份--------------
echo --------------------------------------------------
echo ...
echo ...
echo 导出Database...
if exist %date%.sql del %date%.sql
c:\Progr*\mysql\bin\mysqldump --add-drop-table -c -u root -p-h localhost dbname >e:\%date%.sql
echo ...
echo ...
if exist dump%date%.7z del dump%date%.7z
echo 压缩文件...
7za.exe a -t7z dump%date%.7z %date%.sql -mx9
echo ...
echo ...
echo 删除临时文件
del %date%.sql
echo ...
echo ...
echo 备份完成!
pause
白云岛资源网 Design By www.pvray.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
白云岛资源网 Design By www.pvray.com
暂无评论...