MYSQL5.5 Master/Slave configuration: A-& gt; B-& gt; C

Source: Internet
Author: User

MYSQL5.5 Master/Slave configuration: A-> B-> c a (Port 3307)-> B (Port 3308)-> C (Port 3309) I. configuration file www.2cto.com A (my. cnf): # configure a unique ID: server-id = 1 # enable binlog-bin log_slave_updates binlog_format = row # configure auto-increment offset auto_increment_increment = 3 auto_increment_offset = 1 B (my. cnf ): # configure a unique ID server-id = 2 # enable binlog log-bin log_slave_updates binlog_format = row # configure auto-increment offset auto_increment_increment = 3 auto_increment_offset = 2 # read-only C (my. cnf ): # configure a unique ID: server-id = 3 # enable binlog log-bin log_slave_updates binlog_format = row # configure auto-increment offset auto_increment_increment = 3 auto_increment_offset = 3 # read-only II, command Line: 1. RESET the master Status: reset master; 2. Authorize the synchronization User: grant replication slave on *. * TO 'repli _ user' @ '%' identified by 'repli _ pwd '; synchronization Username: repli_user, synchronization Username: repli_pwd, and permission IP address for replication slave: % (precise IP Address used in production) 3. Back up all data in database: mysqldump-uroot-p **-P3307-A-E-R -- master-data = 1> master_A. SQL B: 1. RESET the slave status: RESET SLAVE; 2. RESET the master Status: reset master; 3. Authorized synchronization User: grant replication slave on *. * TO 'repli _ user' @ '%' identified by 'repli _ pwd'; 4. Synchronization parameter configuration: change master to MASTER_HOST = 'localhost ', MASTER_USER = 'repli _ user', MASTER_PASSWORD = 'repli _ pwd', MASTER_PORT = 3307; 5. Import master database data: mysql-uroot-p **-P3307 <master_A. SQL 6. enable synchronization: start SLAVE; 7. Back up all data in database B: mysqldump-uroot-p **-P3308-A-E-R -- master-data = 1> master_ B. SQL C: 1. RESET the slave status: RESET SLAVE; 2. Configure synchronization parameters: change master to MASTER_HOST = 'localhost', MASTER_USER = 'repli _ user', MASTER_PASSWORD = 'repli _ pwd', MASTER_PORT = 3308; 3. import data from the MASTER database: mysql-uroot-p **-P3309 <master_ B. SQL 4. enable synchronization: start SLAVE;

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.