美文网首页
mysql 主从配置

mysql 主从配置

作者: 青城楼主 | 来源:发表于2018-07-18 08:51 被阅读7次

1,master配置

/etc/my.cnf配置

log-bin=mysql-bin server-id=2 binlog-ignore-db=information_schema binlog-ignore-db=cluster binlog-ignore-db=mysql binlog-do-db=ufind_db

授权

>GRANT FILE ON *.* TO 'root'@'192.168.1.2' IDENTIFIED BY 'mysql password'; >GRANT REPLICATION SLAVE ON *.* TO 'root'@'192.168.1.2' IDENTIFIED BY 'mysql password'; >FLUSH PRIVILEGES

2,slave配置

/etc/my.cnf配置

log-bin=mysql-bin server-id=3 binlog-ignore-db=information_schema binlog-ignore-db=cluster binlog-ignore-db=mysql replicate-do-db=ufind_db replicate-ignore-db=mysql log-slave-updates slave-skip-errors=all slave-net-timeout=60

设置master信息

change master to master_host='192.168.1.1',master_user='root',master_password='123456',master_log_file='mysql-bin.000004', master_log_pos=28125;

相关文章

网友评论

      本文标题:mysql 主从配置

      本文链接:https://www.haomeiwen.com/subject/kkcchftx.html