Home >Database >Mysql Tutorial >linux系统mysql数据库自动备份_MySQL

linux系统mysql数据库自动备份_MySQL

WBOY
WBOYOriginal
2016-06-01 13:34:04873browse

bitsCN.com

linux系统mysql数据库自动备份

 

1、建一个shell脚本 

 

   vi bak.sh 

 

  mysqldump -u用户名 -p密码 --database 数据库名 > data.sql 

 

2、脚本授权 

 

   chmod +x bak.sh 

 

3、使用crontab命令定期执行脚本 

 

   crontab -e 

 

   在任务中输入: 

 

   0 0 * * * /脚本路径/bak.sh 

bitsCN.com
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