【MySQL】Authentication plugin 'caching_sha2_password' reported error
2022-09-02 21:52 abce 阅读(1614) 评论(0) 编辑 收藏 举报使用MySQL8.0.30创建主从,启动从库的时候报错:
1 2 | Last_IO_Errno:2061 Last_IO_Error:error connecting to mater 'repl@xxxxx:3308' - retry- time :60 retries:1 massage:Authentication plugin 'caching_sha2_password' reported error:Authentication require secure connection . |
原因是在MySQL8之前,身份验证插件默认是mysql_native_password;而从8.0开始,换成了caching_sha2_password。
1.可以在mysql server的配置文件中,继续使用旧的验证插件。在配置文件中即可。
1 2 | [mysqld] default_authentication_plugin=mysql_native_password |
2.也可以在用户级别进行修改,修改用户使用的验证插件即可:
1 2 3 | alter user '[username]' @ '[host]' \ identified with mysql_native_password \ by '[password]' ; |
3.也可以使用GET_MASTER_PUBLIC_KEY=1,请求公钥:
1 | mysql> change master to master_host= 'xxxx' , master_port=3308, master_user= 'repl' , master_password= 'pwd' ,master_auto_position = 1,get_master_public_key=1; |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
2018-09-02 mysql optimize table
2015-09-02 11G新特性 -- OLTP Table Compression
2015-09-02 11G新特性 -- 收缩临时表空间