MySQL 5.7 master-slave configuration

Source: Internet
Author: User

  

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

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.