MySQL8.0主从复制报错:Last_IO_Error: Authentication plugin ‘caching_sha2_password‘ reported error

报错信息

具体报错信息:Last_IO_Error: error connecting to master ‘haimeng@192.XXX’ - retry-time: 60 retries: 7 message: Authentication plugin ‘caching_sha2_password’ reported error: Authentication requires secure connection.

报错原因:
遇到的问题是关于MySQL的复制配置,特别是使用SSL连接时的问题。错误信息表明,正在尝试使用非安全的连接进行身份验证,而这在MySQL 8.0及更高版本中是不允许的。

具体来说,问题出在MySQL的复制设置中。当使用SSL连接时,MySQL要求使用安全的连接进行身份验证。错误信息中提到的 “Authentication plugin ‘caching_sha2_password’ reported error: Authentication requires secure connection.” 表明了这一点。

解决办法:

方法一

更改身份验证插件

# 修改身份验证插件
ALTER USER 'haimeng'@'192.168.145.130' IDENTIFIED WITH 'mysql_native_password' BY 'password';  

#重新加载授权表。当你更改了用户的权限或其他相关的安全设置后,为了让这些更改立即生效,
FLUSH PRIVILEGES;

方法二

1、从机停止主从复制:stop slave
2、重置所有主从复制信息:reset slave
3、重新进行change master to

change master to master_host='192.168.145.130',master_user='mengting',master_password='0123456789',master_log_file='mysql-bin.000011',master_log_pos=156,get_master_public_key=1;

我们在后面添加了:get_master_public_key=1

在这里插入图片描述

  • 6
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

海梦在飘扬

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值