AB replication (mysql synchronization) _ MySQL-mysql tutorial

Source: Internet
Author: User
AB replication (mysql synchronization) bitsCN.com

Project Environment:
All systems are cent OS 5.5
Master server IP address: 192.168.19.172 (master)
Slave server IP: 192.168.19.168 (slave)
Both of them have set up mysql (the root user and password are empty)
1: Set synchronization master and modify the mysql master configuration file:
Server-id = 1
Log-bin
Set-variable = binlog-ignore-db = mysql
2: then add an account on the Master for synchronization, as shown below:
Grant replication slave on *. * TO rep@192.168.19.168 identified by rep;
3: query the status of the primary database (master)
Show master status;

Note:
Record the file and position parameters on the master server
4. configure slave server slave and modify the configuration file
Modify my. cnf and add the following lines:
Server-id = 2
Master-user = rep
Master-password = rep
Master-port = 3306
5: Configure command items,

6: start slave; the replication function is enabled.
7: view the synchronization status,

Note:
Slave_IO_Running: Yes and Slave_ SQL _Running: Yes if the two statuses are not yes, check whether the above configuration is correct, mainly because the file and position settings are correct, and whether the slave database can log in with the account of the master database

BitsCN.com
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.