zoukankan      html  css  js  c++  java
  • Windows下Mysql 定时自动备份到指定位置

    Mysql 定时自动备份到指定位置

     1 set h=%time:~0,2%
     2 set h=%h: =0%
     3 set bak_filename=%date:~0,4%%date:~5,2%%date:~8,2%%h%%time:~3,2%%time:~6,2%
     4 @ECHO %tm%
     5 SET bkupdir=F:Databackup
     6 SET mysqldir=F:WEBupupwMySQL
     7 path=%path:;F:WEBupupwMySQLin;%
     8 SET dbname=mysql
     9 SET dbuser=root
    10 SET dbpassword=root
    11 SET CharacterSet=utf8
    12 @ECHO Beginning backup of %dbname%... 
    13 mysqldump -u%dbuser% -p%dbpassword% mysql>%bkupdir%\%dbname%%bak_filename%.sql
    14 @ECHO Done! New file: %bkupdir%\%dbname%-%bak_filename%.sql

    把以上代码保存为.bat 文件然后加入windows计划任务就能实现windows下mysql每日定时备份了,根据以上代码,相信你也能写出在linux下定时执行PHP的代码了,我在这里就不写了,如有需求可留言。

  • 相关阅读:
    HDU 3547 DIY Cube
    POJ 2975 Nim
    POJ 1678 I Love this Game!
    POJ 2234 Matches Game
    POJ 3537 Crosses and Crosses
    POJ 3710 Christmas Game
    POJ 1704 Georgia and Bob
    HDU 3923 Invoker
    POJ 2154 Color
    PLM更新自定义CLASS
  • 原文地址:https://www.cnblogs.com/icanlxc/p/3992488.html
Copyright © 2011-2022 走看看