Mysql database Two-Computer hot standby Configuration method (1/3)

Source: Internet
Author: User
Tags mysql tutorial

1. MySQL Tutorial Database Tutorial There is no mechanism for incremental backups, and backup is a big problem when the volume of data is too large. Fortunately, the MySQL database provides a master-slave backup mechanism, which is to write all the data in the primary database at the same time to the backup database. To achieve a hot backup of the MySQL database.
2. In order to realize the hot standby of two machines, you must first understand the requirements of the master and slave database server version. To achieve a hot standby version of MySQL is higher than 3.2, there is also a basic principle is that the database version from the database can be higher than the primary server database version, but not lower than the primary server version of the database.
3. Set up the primary database server: 111cn.net
A. First see if the version of the primary server is a backup-hot version. Then look at the configuration of the MYSQLD configuration block in My.cnf (Unix-like) or My.ini (Windows) there is no Log-bin (logging database change log), because the MySQL replication mechanism is based on the log replication mechanism, so the primary server must support the change log. Then set up the database to write to the log or do not write to the log. This will only make changes to the database that you are interested in writing to the database log.
Server-id=1//database ID This should default to be 1 do not have to change
Log-bin=log_name//log file name, where you can make log to other directories if no setting then a log name for the default host name
Binlog-do-db=db_name//Log database
Binlog-ignore-db=db_name//No log database
If more than one database is used "," split
Then set up a synchronization database user account br> mysql> GRANT REPLICATION SLAVE on *.*
-> to ' repl ' @ '%.mydomain.com ' identified by ' slavepass ';
4.0.2 Previous versions because replication is not supported to implement this feature using the following statement
Mysql> GRANT FILE on *.*
-> to ' repl ' @ '%.mydomain.com ' I Dentified by ' Slavepass ';
Restart the database after setting the configuration file for the primary server
B. Lock the existing database and back up the current data  

home 1 2 3 last
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.