centos7-mysql-binlog-bump-Backup Restore

Source: Internet
Author: User
Tags mysql backup

MySQL backup is generally a full-library backup +binlog log Incremental backup
perform a full library in a few days, and perform an incremental backup several hours a day.
Binlog Log
This binary log file records all of the database additions and deletions of the operation.
Role has
1, master-Slave synchronization
2, Reply to Database
Binlog Open Vim my.cnf
Log-bin=/usr/local/mysql/data/mysql-bin Specify log file location, turn on Binlog function
Mysqlbinlog-v log file to view the contents of the log file
The Mysql-bin.index file holds the location and name of the Binlog log file.
-----------------------------------------------------------------------
Backup and restore of Binlog
Backup
MYSQLBINLOG-V file name > file name. SQL Backup entire Binlog file
Mysqlbinlog-v--stop-position=300/****/mysql-bin.000003 >/300.sql back up the Binlog event of a 千300 file to a 300.sql file
Mysqlbinlog-v--start-position=600/****/mysql-bin.000003 >/600.sql will have 600 start to end binlog files stored in 600.sql
Skipping is generally used to skip the error operation,
Restores
mysql-uroot-p123456 </file name. sql
In order to execute, the order of the wrong reply will also have a problem
-------------------------------------------------------------------------
Mysqldump MySQL comes with a backup tool
The main is to export the backup table data into a SQL script file, is considered a logical backup
If the general data is small, the mysqldump backup is selected, and if the volume is large, other backup tools are recommended.
mysqldump-uroot-p123456--all-databases >/gao.sql Backup All
--databases Library name > Gao.sql backing up a single library
Library Name Table name > Gao.sql back up a single table
mysql-uroot-p123456 < Gao.sql Restore
---------------------------------------------------------------------------
Generally in the production environment, backup is done using scripts, easy and fast, and the database generally at night is low peak period, so usually back up in the evening
A full backup script, because the virtual machine does not have other software installed, so if necessary, or mailbox reminders, you can later add
650) this.width=650; "height=" 415 "src=" http://b287.photo.store.qq.com/psb?/81c1194a-ff39-4e50-b1b1-40057b06260f/ xzpd5umjdti0ur1yb95*bq00crqyih48vmon7bmc3cc!/b/db8baaaaaaaa&bo=zgkfaqaaaaafege! "width=" 718 "style=" vertical-align:top; "alt=" db8baaaaaaaa&bo=zgkfaqaaaaafege! "/>
And there's an incremental backup of Binlog.
650) this.width=650; "height=" 624 "src=" http://b287.photo.store.qq.com/psb?/81c1194a-ff39-4e50-b1b1-40057b06260f/ mugydjnlwwul6igktc*lza6ytqvkt7qjqa3dwu2rg8q!/b/db8baaaaaaaa&bo=pwjwagaaaaafehw! "width=" 575 "style=" vertical-align:top; "alt=" db8baaaaaaaa&bo=pwjwagaaaaafehw! "/>
650) this.width=650; "height=" 107 "src=" http://b286.photo.store.qq.com/psb?/81c1194a-ff39-4e50-b1b1-40057b06260f/ fj1hwa8svzf6culqpq*ikkzpcjligwucdmvy5iha7h0!/b/db4baaaaaaaa&bo=tqjraaaaaaafeo8! "width=" 693 "style=" vertical-align:top; "alt=" db4baaaaaaaa&bo=tqjraaaaaaafeo8! "/>

This article is from the "11627223" blog, please be sure to keep this source http://11637223.blog.51cto.com/11627223/1911979

centos7-mysql-binlog-bump-Backup Restore

Related Article

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.