【MySQL】Authentication plugin 'caching_sha2_password' reported error
转自:https://www.cnblogs.com/abclife/p/16651489.html
使用MySQL8.0.30创建主从,启动从库的时候报错:
|
1
2
|
Last_IO_Errno:2061Last_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; |
本文来自博客园,作者:蓝迷梦,转载请注明原文链接:https://www.cnblogs.com/hewei-blogs/articles/17616817.html

浙公网安备 33010602011771号