From the main mysql-

 

Installation and deployment mysql master-slave replication environment

1. Use the yum install mysql deployment of two

yum -y install mariadb mariadb-server

2. Turn off the firewall and selinux

systemctl stop firewalld.service

setenforce 0

3. modify the configuration of two main configuration file mysql

Machine 1: vim /etc/my.cnf

log_bin=mysql-bin

server_id=1

Machine 2: vim /etc/my.cnf

relay_log=relays

server_id=2

4. Start the database

 

5. Create a new user name in their own name, led letters in mysql and authorized

 

 

 

 6. Test results from master mysql

 

7. Detailed mysql master writing types from the three kinds of copy

  ① statement-based replication

  ② row-based replication

  ③ hybrid replication

Guess you like

Origin www.cnblogs.com/rm580036/p/12570291.html