mysql主存binlog同步

  1. 修改主库my.ini
    在这里插入图片描述

  2. 修改存库配置文件
    在这里插入图片描述

注意

主从的server-id 不能重复

  1. 在主mysql里面配置从库的用户信息

    grant replication slave on *.* to 'backup_user' @'%' identified by 'backup@ghsx2019';
    
  2. 在从库的mysql中配置:

    change master to master_host='172.17.227.217',
    master_port=12099,
    master_user='slave',
    master_password='elecidenti!123',
    master_log_file='master-bin.000006',
    master_log_pos=180069
    

如果出现:Got fatal error 1236 from master when reading data from binary log

需要在主库中执行:

flush logs;
show master status;

然后去从库设置下:

CHANGE MASTER TO MASTER_LOG_FILE='testdbbinlog.000008',MASTER_LOG_POS=107;
slave start;
show slave status \G

mysql主存binlog同步_第1张图片

参考:https://blog.csdn.net/yangfenggh/article/details/98237751
https://www.cnblogs.com/l-hh/p/9922548.html#top
https://blog.csdn.net/lixora/article/details/78788535
https://blog.csdn.net/zleiw/article/details/78243316

https://www.baidu.com/link?url=d3hSkN7clipuvERqKn1w-IkUq782tZxBVmwd1ietVnt1c2_ZoQyBKwJPUQw9mYAEZ396OnYNgke_i-QNLnaKwZZGUM_E2911_kjqBYnQRhu&wd=&eqid=b46534830010ed67000000035ddb8546

https://blog.csdn.net/qq_38802291/article/details/83303094

https://blog.csdn.net/xiaoyuerp/article/details/83756366

你可能感兴趣的:(Linux)