Master: 192.168.10.144
From: 192.168.10.113
Main:
Mysql-u root-p
Create user slave;
Grant Replication Slave on * * to ' slave ' @ ' 192.168.10.113 ' identified by ' MySQL ';
Note: 192.168.10.113 is an IP from the slave
To modify the/ETC/MYSQL/MYSQL.CONF.D/MYSQLD.CNF, the following information:
#重启mysql
service MySQL restart;
Mysql-u root-p;
Show master status;
From:
Change Master to master_host= ' 192.168.10.144 ', master_user= ' slave ', master_password= ' MySQL ', master_port=3306,master _log_file= ' mysql-bin.000001 ', master_log_pos=603;
192.168.10.144 master MySQL, mysql-bin.000001, 603, corresponds to the result of show master status on the primary server.
Show Slave Status\g
1. If remote access is turned on:
In the/etc/mysql/mysql.conf.d/mysqld.cnf file, comment out the following:
Mysql>use MySQL;
Mysql>update user set host= '% ' where user= ' root ';
Mysql>flush privileges; --Refresh the MySQL system permissions related table;
2. Remove the permissions granted by the slave.
Stop slave;
Change master to master_host= ';
Start slave;
Reference:
http://rainbow702.iteye.com/blog/1558412
http://blog.yuansc.com/2016/02/17/mysql-5-7%E4%BA%92%E4%B8%BA%E4%B8%BB%E4%BB%8E%E5%90%8C%E6%AD%A5%E9%85%8D%E7%BD%AE/
http://www.cfei.net/archives/1066
MySQL 5.7 master-slave configuration