(Original) MySQL synchronization (5) Implementation

Source: Internet
Author: User
1. Unidirectional Replication
Mysql5.0 and later versions
Server (master ): # Uniquely identifies the server instance In The Community Of   Replication Partners.
Server - ID = 1
Log - Bin = Mysql_bin
BINLOG - Do - DB = Test

And create an account for synchronization MySQL >   Grant   Replication Slave On   * . *  
->   To   ' Repadmin ' @ ' 192.168.1.223 ' Identified By   ' Repadmin ' ;

Client (slave ): Master - Host = 192.168 . 1.72
Master - User = Repadmin
Master - Password = Repadmin
Master - Port = 3306
Server - ID = 2
Master - Connect - Retry = 60
Replicate - Do - DB = Test

Note:
1. After changing my. ini, the files generated under the Data Directory: master.info, relay-log.info, if you want to change the my. ini file, delete the two files and restart.
2. When start slave; is enabled, the files generated under the Data Directory are 45494b7bb4b14e4-relay-bin.000047 and 45494b7bb4b14e4-relay-bin.index.
3. view the server and client status:Show slave status;
Show slave status \ G;
Show processlist;
Show processlist \ G;

Show Master status;
Show Master Status \ G;
Show processlist;
Show processlist \ G;

Show processlist \ G;

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.