MySQL master-Slave Build-yum Chapter

Source: Internet
Author: User

premise: In two machines first confirm SELinux,iptables shut down, do a good yum source


First, build

Do the following on the 143:

Yum install-y MySQL Mysql-server

then modify /etc/my.cnf to add two lines in the mysqld module.

Log-bin=mysql-bin

Server-id = 1

then start the Msyql/etc/init.d/mysql start

Do the following on the 144:

Yum install–y MySQL Mysql-server

then modify the/etc/my.cnf to add in the mysqld module.

Server-id = 2

then restart Mysql/etc/init.d/mysql start


Ii. Delegation of authority

to operate on 143:

MySQL # into MySQL

Grant Replication Slave on * * [email protected] ' 192.168.223.144 ' identified by ' 123456 ';

to 144 server authorization, account number is Tongbu, password is 123456

Flush privileges; # Refresh Permissions

Show master status; # View synchronized filenames and points

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/71/9F/wKiom1XVLNnDqbDoAAD_CtO-JtE568.jpg "title=" 123. PNG "alt=" wkiom1xvlnndqbdoaad_cto-jte568.jpg "/>

to operate on 144:

MySQL # into MySQL

C hange Master to

Master_host= ' 192.168.223.143 ', master_user= ' Tongbu ', master_password= ' 123456 ', master_log_file= ' mysql-bin.000003 ' , master_log_pos=345;

Flush privileges; # Refresh Permissions

Slave start; # Open from

show slave status\g; Check the master and slave status, if you see the following two yes indicates that master and slave is OK

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/71/9C/wKioL1XVLx3i9ZcEAAMJYVYqzgY409.jpg "title=" 12.png "alt=" Wkiol1xvlx3i9zceaamjyvyqzgy409.jpg "/>




This article is from the "PC personal blog" blog, make sure to keep this source http://pc1990.blog.51cto.com/10541224/1686284

MySQL master-Slave Build-yum Chapter

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.