Home  >  Article  >  Database  >  Linux 怎么通过Shell脚本定时备份MySQL数据库

Linux 怎么通过Shell脚本定时备份MySQL数据库

WBOY
WBOYOriginal
2016-06-07 17:06:301026browse

为了应对意外,备份数据库是非常必须的。备份脚本怎么写呢? 在写脚本之前,先假设mysql的bin目录是:/usr/local/mysql/bin/ PA

为了应对意外,备份数据库是非常必须的。备份脚本怎么写呢?

在写脚本之前,,先假设mysql的bin目录是:/usr/local/mysql/bin/

将上面的脚本保存为 .backup.sh 加入到 crontab 中即可。具体怎么加到计划任务,请参阅:Linux下Nginx如何切割访问日志? (见 ) 和 Linux crontab命令小解 (见  ) 

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn