mysql5.6 master-slave replication, detailed configuration

Source: Internet
Author: User

Environment: Centos 6.5

mysql5.6

The virtual machine environment is used

Master ip:192.168.17.140

Slaver ip:192.168.17.141


Start configuration below:

Configuration of Master:

1. Note the arrows:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/43/6B/wKiom1PaV-DCeGo3AAHwX5yo73E802.jpg "title=" 1.jpg " alt= "Wkiom1pav-dcego3aahwx5yo73e802.jpg"/>

2: Restart the MySQL service

Shell:service mysqld Restart

3. See:

The command is as follows:

Mysql-u root-p

Grant replication Slave,replication Client on * * to ' root ' @ ' 192.168.17.141 '

Identified by ' happy123 ';

Show Master Status \g

-------------------------------Gorgeous split-line--------------------------

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/43/6B/wKioL1PaWaWR0mbVAALEWfDrT8I926.jpg "title=" 2.jpg " alt= "Wkiol1pawawr0mbvaalewfdrt8i926.jpg"/>


Slaver configuration:

    1. See:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/43/6B/wKioL1PaWqrxW7W3AAHY1nGCwLU772.jpg "title=" 3.jpg " alt= "Wkiol1pawqrxw7w3aahy1ngcwlu772.jpg"/>


2. Restart the server, go to the client, and execute the following command:

Just note that the following log is consistent with the above master view

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/43/6B/wKiom1PaWdSBu68HAAD-TAlrU4A688.jpg "title=" 4.jpg " alt= "Wkiom1pawdsbu68haad-talru4a688.jpg"/>

3. View slave situation

show slave status \g;

The following situation occurs because my slave is cloned, so the UUID in the auto.cnf file in the MySQL data directory is the same as

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/43/6B/wKiom1PaWmOSyKjHAAGcmbEalAM310.jpg "title=" 5.jpg " alt= "Wkiom1pawmosykjhaagcmbealam310.jpg"/>


And then we can do this:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/43/6B/wKioL1PaXAqzUX-5AAKIsu0PIYg518.jpg "title=" 6.jpg " alt= "Wkiol1paxaqzux-5aakisu0piyg518.jpg"/>


Again start slave, the following page appears: Indicates that the configuration was successful:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/43/6B/wKiom1PaW07g-nwHAAIhBED4vkQ025.jpg "title=" 7.jpg " alt= "Wkiom1paw07g-nwhaaihbed4vkq025.jpg"/>


I have carried out the test myself, can be achieved.

The final summary: errors to see the above log, it is clear that you can find out what the problem.




This article from "Little Just Blog" blog, declined reprint!

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.