<主从复制的配置>
若主机ip:192.168.1.3
在主机上:
log-bin = master_bin
log-bin-index = master-bin.index
server-id = 1
create user replislave;
grant replication slave on *.* to replislave identified by 'pwd';
在备机上:
relay-log-index = slave-replay-bin.index
relay-log = slave-relay-bin
server-id = 2
执行语句(在slave上执行):
change master to
master_host = '192.168.1.3',
master_port = 3306,
master_user = 'replislave',
master_password = 'pwd';