脚本宝典收集整理的这篇文章主要介绍了Public Key Retrieval is not allowed,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
根据前面的分析,导致“Public Key Retrieval is not allowed”主要是由于当禁用 SSL/TLS 协议传输后,客户端会使用服务器的公钥进行传输,默认情况下客户端不会主动去找服务器拿公钥,此时就会出现上述错误。
经过查阅官方文档,出现 Public Key Retrieval 的场景可以概括为在禁用 SSL/TLS 协议传输切当前用户在服务器端没有登录缓存的情况下,客户端没有办法拿到服务器的公钥。具体的场景如下:
- 新建数据库用户,首次登录;
- 数据库的用户名、密码发生改变后登录;
- 服务器端调用 FLUSH PRIVELEGES 指令刷新服务器缓存。
针对上述错误,有如下的解决方案:
- 在条件允许的情况下,不要禁用 SSL/TLS 协议,即不要在 CLI 客户端使用--ssl-mode=disabled,或在 JDBC 连接串中加入 useSSL=false;
- 如果必须禁用 SSL/TLS 协议,则可以尝试使用 CLI 客户端登录一次 MySQL 数据库制造登录缓存;
- 如果必须禁用 SSL/TLS 协议,则可以通过增加如下参数允许客户端获得服务器的公钥:
- 在 JDBC 连接串中加入 allowPublicKeyRetrieval=true 参数;
- 在 CLI 客户端连接时加入--get-server-public-key 参数;
- 在 CLI 客户端连接时加入--server-public-key-path=file_name 参数,指定存放在本地的公钥文件。
TRANSLATE with x
TRANSLATE with
COPY THE URL BELOW
Back
EMBED THE SNIPPET BELOW IN YOUR SITE
Enable collaborative features and customize widget: Bing Webmaster Portal
Back
脚本宝典总结
以上是脚本宝典为你收集整理的Public Key Retrieval is not allowed全部内容,希望文章能够帮你解决Public Key Retrieval is not allowed所遇到的问题。
如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。