多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
**修改my.cnf** ``` log-bin=mysql-bin //开启二进制日志 server-id=222 // 保持server-id一致 replicate-db-db=testdb //指定需要复制的db binlog-ignore-db=mysql //忽略的db binlog-ignore-db=information_schema //忽略的db auto-increment-increment=2 //防止主键冲突,id + 2 auto-increment-offset=1 ``` 重启mysql服务 hostA hostB 在hostA上执行 grant replication slave on *.* to dsa@ 'hostB_ip' identified by 'password'; 在 hostB上执行 change master to master_user='dsa',master_password='password',master_host='hostA_ip',master_log_file='',master_log_pos='position';