专业的编程技术博客社区

网站首页 > 博客文章 正文

MySQL主从复制报错Authentication

baijin 2024-09-10 11:05:02 博客文章 14 ℃ 0 评论

系统数据库使用主从配置时,发现今天开始,从库并没有同步主从上的日志,在从库上执行 show slave status;

显示报错:

Last_IO_Error: error connecting to master 'repl@127.0.0.1:3306' - retry-time: 60 retries: 2 message: Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection.

考虑到我的MySQL8 ,


查看主库:

SELECT plugin FROM `user` where user = 'repl';

原来是主库repl的plugin是caching_sha2_password 导致连接不上,修改为mysql_native_password即可解决。执行以下语句:


ALTER USER 'repl'@'%' IDENTIFIED WITH mysql_native_password BY '原先账户的密码';

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表