标签归档:MySQL主主同步

MYSQL MASTER-MASTER复制

主主同步步骤,这里同步的数据库是TEST
1、环境描述。
主机:192.168.0.231(A)
主机:192.168.0.232(B)
MYSQL 版本为5.1.21
2、授权用户。
A:

mysql> grant replication slave,file on *.* to 'repl1'@'192.168.0.232' identified by '123456';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

B:

mysql> grant replication slave,file on *.* to 'repl2'@'192.168.0.231' identified by '123456';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

然后都停止MYSQL 服务器。 继续阅读