Mysql tutorial - automatic database backup

 



    Batch command:

  set"Ymd=%date:~,4%%date:~5,2%%date:~8,2%"

  set"hMs=%time:~,2%%time:~3,2 %%time:~6,2%"

  mysqldump-uroot --password=password weixin> D:\mysql_back\weixin_%Ymd%_%hMs%.sql

  command explanation To

  use mysqldump, you need to set the environment variable

  Mysqldump.exe program in mysql Set in the bin directory of the installation directory

  is a batch command to set variables.

  %date:~, 4% is a string that takes the date variable position 0 and starts with a length of 4.

  %date:~5, 2% is a string that takes the date variable position 5 and starts with a length of 4. The string

  weixin is the name of the database

  > followed by the output directory.

  Windows task planning implements a batch process at intervals. Enter taskschd.msc in the

  run (win+R) to open the task scheduler.

  Click the task scheduler library and there is a basic task on the

  right .

  Step by step configuration

  Finally , enter the path of the batch

process. You can manage the task plan in the task planner. The

above is organized by Brothers IT Education. Brothers with PHP training.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326408002&siteId=291194637