Home > Database > Mysql Tutorial > MYSQL自动备份脚本

MYSQL自动备份脚本

WBOY
Release: 2016-06-07 16:14:30
Original
906 people have browsed it

date_str=`date +%Y%m%d`cd /data2/backupmysqldump -h localhost -u oschina --password=xxxx -R -E -e \ --max_allowed_packet=1048576 --net_buffer_length=16384 mydb\ | gzip /data2/backup/mydb_$date_str.sql.gz

date_str=`date +%Y%m%d`
cd /data2/backup
mysqldump -h localhost -u oschina --password=xxxx -R -E -e \
  --max_allowed_packet=1048576 --net_buffer_length=16384 mydb\
   | gzip > /data2/backup/mydb_$date_str.sql.gz
Copy after login
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template