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

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:34:04
Original
905 people have browsed it

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
Related labels:
source:php.cn
Statement of this Website
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
Latest Issues
Database file import
From 1970-01-01 08:00:00
0
0
0
database
From 1970-01-01 08:00:00
0
0
0
Database design - mysql database integration
From 1970-01-01 08:00:00
0
0
0
Database garbled,
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template