数据库主从同步

主服务器

vim /etc/my.cnf

添加

server-id=1
log-bin=master-bin
log-bin-index=master-bin.index

保存重启

登陆数据库,show master status

附属数据库

同上添加如下内容重启

主数据库

create user repl;

flush privileges;

附属数据库

 

 

 

grant replication slave on *.* to 'repl' @ ' 192.168.199.233' identified by 'mysql'

猜你喜欢

转载自www.cnblogs.com/shufeiyang/p/10765781.html