【问题标题】:how to solve mysql master slave replication error如何解决mysql主从复制错误
【发布时间】:2021-10-11 07:19:08
【问题描述】:

我正在尝试配置mysql主从配置 在带有 mysql 版本 8 的 centos 7 中 点击链接https://linuxize.com/post/how-to-configure-mysql-master-slave-replication-on-centos-7/ 一切顺利,没有错误 但最后当检查 > show slave status\G in slave server 我有错误

Last_IO_Error: error connecting to master 'replica@xx.xx.xx.xx:3306' - retry-time: 60 retries: 1 message: Can't connect to MySQL server on 'xx.xx.xx.xx:3306' (113)
Slave_IO_Running: Connecting
Slave_SQL_Running: Yes

xx.xx.xx.xx是主服务器ip 由于上述问题,数据库未复制 端口已打开

任何解决问题的线索

【问题讨论】:

    标签: mysql replication master-slave


    【解决方案1】:

    首先,检查您没有防火墙问题,并且 Slave 主机可以通过 3306/TCP 端口正确连接到 Master。

    如果没问题,请确保主服务器上的“副本”MySQL 用户具有正确的 GRANT,并且您已经执行了一个

    FLUSH PRIVILEGES;
    

    之后:

    GRANT REPLICATION SLAVE ON *.* TO 'replica'@'xxx.xxx.xxx.xxx';
    

    以便立即考虑命令 (看起来提供的文档中缺少此步骤)

    【讨论】:

      猜你喜欢
      • 2012-05-14
      • 2014-09-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-16
      • 2018-03-06
      • 2012-06-26
      相关资源
      最近更新 更多