• Mysql master-master replication


    slave:
    binlog_format="MIXED"
     
    log-bin=mysql-bin
    relay-log=relay-mysql
    relay-log-index=relay-mysql.index
    auto-increment-increment=2
    auto-increment-offset=2
     
    master:
    binlog_format="MIXED"
     
    log-bin=mysql-bin
    relay-log=relay-mysql
    relay-log-index=relay-mysql.index
    auto-increment-increment=2
    auto-increment-offset=1
     
     
     
    SQL:
     
    CREATE USER 'repl'@'192.168.1.%' IDENTIFIED BY 'repl';
    GRANT REPLICATION SLAVE ON *.* TO 'repl'@'192.168.1.%';
    flush privileges;
     
    CHANGE MASTER TO MASTER_HOST='172.16.0.92', MASTER_USER='repl', MASTER_PASSWORD='repl', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=120;
     
     
    TEST SQL:
    show variables like '$server_id%';
     
    show master status;
    show slave status;
     
    [slave上执行]
    start slave;
    stop slave;
    reset slave; 
     
    参考: http://blog.csdn.net/heizistudio/article/details/8616997
  • 相关阅读:
    上机练习3
    上机练习2
    上机练习1
    第一次作业
    第二次作业
    第一次作业
    第二次作业(4)
    第二次作业(3)
    第二次作业(2)
    第二次作业(1)
  • 原文地址:https://www.cnblogs.com/shevche/p/4632204.html
Copyright © 2020-2023  润新知