Mysql automated backup solution _ MySQL

Source: Internet
Author: User
Tags mysql automatic backup mysql backup
Mysql automated backup solution bitsCN.com
Mysql automatic backup solution 1. configure the database server 1. write the mysql automatic backup script mysql backup mainly includes hot backup and cold backup. hot backup is used here, that is, using mysqldump to export SQL statements to back up # vi/etc/mysqlback. sh #! /Bin/bash DB_NAME = "luwenju" // DB_USER = "luwenju" // database username DB_PASS = "luwenju" // database password BIN_DIR = "/usr/local /mysql/bin "// mysql environment variable BACK_DIR ="/opt "// backup file save data DATE =" 'date + % Y % m % d "'$ BIN_DIR/ mysqldump-opt-u $ DB_USER-p $ DB_PASS $ DB_NAME> $ BACK_DIR/luwenju _ $ DATE. SQL # chmod + x/etc/mysqlback. sh Test #/etc/mysqlback. sh # ls/opt/luwenju_20151126.sql2. set the regular backup cycle. in this case, backup is performed every morning, the specific backup cycle depends on the specific application # crontab-e0 0 ***/etc/mysqlback. sh #/etc/init. d/crond restart3, install rsync # tar zxvf rsync-3.0.8.tar.gz # cd rsync-3.0.8 #. /configure & make install to create the configuration file and add the following content # vi/etc/rsync. confuid = nobody gid = nobodyuse chroot = nomax connections = 10pid file =/var/run/rsyncd. pidlock file =/var/run/rsyncd. locklog file =/var/log/rsyncd. logport = 873 timeout = 300 [backup] read only = yes // read-only mode list = yesignore errorscomment = This is a file backpath =/opt // the directory to be synchronized auth users = test // verify the user secrets file =/etc/rsync. passwd // verify the password path hosts allow = 119.232.33.246 // ibmfahsionbitsCN.com

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.