MySQL双向复制技术详解
2010-08-23 15:58:30 来源:WEB开发网重启MySQL,创建一个MySQL帐号为同步专用
GRANT REPLICATION SLAVE,RELOAD,SUPER, ON *.* TO back@192.168.0.2 IDENTIFIED BY 'back' ;
FLUSH PRIVILEGES ;
2、设置同步Slave
修改my.cnf文件,添加
server-id = 2
master-host = 192.168.0.1
master-user = back
master-password = back
master-port = 3306
replicate-ignore-db=mysql (我的是Ver 14.14 Distrib 5.1.22-rc版,这个参数好像用不上)
replicate-do-db=test
重启MySQL
3、启动同步
在主服务器A MySQL命令符下:
show master status;
显示(当然这个是我机器的情况,你的不可能跟我一样哈,只是个例子):
+------------------+----------+-------------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+-------------------+------------------+
| updatelog.000028 | 313361 | test | mysql |
+------------------+----------+-------------------+------------------+
更多精彩
赞助商链接