The working principle and configuration of Mysql replication

Source: Internet
Author: User

MySQL replication (Replication) works: The slave end is replicated through the network to the slave end by using the binlog of the master end, and then through the SQL thread to parse the logs in the Binlog and apply them to the database.

1) Physical environment

Master A 172.16.100.106

Slave B 172.16.100.108

2) configuration of Maser end

Build a MySQL user on the primary server to enable Telnet to the primary server from the server

Grant replication slave on *.* to ' David ' @ ' 172.16.100.108 ' identified by ' MySQL '

Edit the configuration file for the master server

/etc/my.cnf

Server-id = 1

Log-bin = Mysql-bin

Binlog-ignore = MySQL//mysql database is not synchronized

Binlog-ignore-db = Information_schema

BINLOG-DO-DB = firstdb//sync L database, default sync all databases

Create database Firstdb for new synchronized databases;

View the status of the primary database

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.