(已解决)Public Key Retrieval is not allowed异常
Public Key Retrieval is not allowed解决方法
Public Key Retrieval is not allowed解决方法
项目场景:
问题描述:
原因分析:
解决方案:
Public Key Retrieval is not allowed解决方法
项目场景:
项目搭建初期连接mysql
问题描述:
在appllication.yml中进行数据库配置 启动空项目是,报错 Public Key Retrieval is not allowed
#数据库配置
datasource:
type: com.alibaba.druid.pool.DruidDataSource
druid:
username: root
password: 123456
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.56.104:3306/company?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=false
1
2
3
4
5
6
7
8
原因分析:
查看官网文档的 https:// https://mysqlconnector.net/connection-options/
Name Default Description
AllowPublicKeyRetrieval, Allow Public Key Retrieval false If the user account uses sha256_password authentication, the password must be protected during transmission; TLS is the preferred mechanism for this, but if it is not available then RSA public key encryption will be used. To specify the server’s RSA public key, use the ServerRSAPublicKeyFile connection string setting, or set AllowPublicKeyRetrieval=True to allow the client to automatically request the public key from the server. Note that AllowPublicKeyRetrieval=True could allow a malicious proxy to perform a MITM attack to get the plaintext password, so it is False by default and must be explicitly enabled.
如果用户帐号使用sha256_password认证,则在传输过程中必须对口令进行保护;TLS是实现这一点的首选机制,但如果它不可用,则将使用RSA公钥加密。要指定服务器的RSA公钥,请使用ServerRSAPublicKeyFile连接字符串设置,或将AllowPublicKeyRetrieval=True设置为允许客户端从服务器自动请求公钥。请注意,AllowPublicKeyRetrieval=True可能允许恶意代理执行MITM攻击以获取明文密码,因此它在默认情况下为False,必须显式启用。
解决方案:
修改Druid的url,添加allowPublicKeyRetrieval=true
#数据库配置
datasource:
type: com.alibaba.druid.pool.DruidDataSource
druid:
url: jdbc:mysql://192.168.56.104:3306/company?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true
(已解决)Public Key Retrieval is not allowed异常的更多相关文章
- 关于JDBC连接数据库时出现的Public Key Retrieval is not allowed错误
问题描述 最近在学习MyBatis框架,参考官方的文档通过配置文件的方式已经实现了通过Configuration配置文件和mapper映射文件访问mysql8数据库,于是想试试不使用XML文件去构建S ...
- JDBC链接数据库MySQL 8.0 Public Key Retrieval is not allowed 错误的解决方法
现象 Mybatis和Spring框架整合过程中报 com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Publ ...
- Jdbc连接MySQL 8时报错“MySQLNonTransientConnectionException: Public Key Retrieval is not allowed”
一.问题 因停电检修,今天重启服务器后,再启动jboss就报错"MySQLNonTransientConnectionException: Public Key Retrieval is n ...
- MySQL连接提示 public key retrieval is not allowed
使用DBeaver连接mysql数据提示public key retrieval is not allowed 修改DBeaver的驱动属性中的allowPublicKeyRetrieval
- Public Key Retrieval is not allowed
链接MySQL数据库报错: 数据库连接url中添加对应属性的支持.allowPublicKeyRetrieval=true&useSSL=false url: jdbc:mysql://loc ...
- spring boot MySQL Public Key Retrieval is not allowed
建议在链接url处添加对应的属性 jdbc:mysql://localhost:3306/book?allowPublicKeyRetrieval=true&useSSL=false
- mysql遇到java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed
在连接数据库的url中,加上allowPublicKeyRetrieval=true from:https://blog.csdn.net/Gushiyuta/article/details/9323 ...
- Nacos使用 MySQL 8.0 提示Public Key Retrieval is not allowed
原因如下(参考官网给出的连接选项): 如果用户使用了 sha256_password 认证,密码在传输过程中必须使用 TLS 协议保护,但是如果 RSA 公钥不可用,可以使用服务器提供的公钥:可以在连 ...
- Mysql8- Public Key Retrieval is not allowed
在使用 MySQL 8.0 时重启应用后提示 com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Public ...
- Mysql8.0 Public Key Retrieval is not allow错误的解决办法
在使用Mysql 8.0时重启后启动项目的事后会报错com.mysql.jdbc.exceptions.jdbc4.MysqlNonTransientConnectionException: Publ ...
随机推荐
- 数据库排行榜|当 DB-Engines 遇见墨天轮国产数据库排行
提到数据库排名,此时脑海里浮现出的是什么?是 DB-Engines,还是墨天轮数据库排行?两者间有什么区别?下面来聊一下业内这两个知名数据库排名平台. 本篇文章约有 3000 字,预计阅读时间 7 分 ...
- 封装JWT - 生成 jwt 和解析 jwt
1. ASP.NET Core 身份验证和授权验证的功能由Authentication,Authorization中间件提供 :app.UseAuthentication(),app.UseAutho ...
- ajax异步请求数据还没有返回,页面时空白的如何处理
使用骨架屏,给用户一种正在解析数据的感觉 : element-ui的骨架屏 :https://element.eleme.cn/#/zh-CN/component/skeleton
- es6有哪些新特性?
1. let 和 ocnst ,可以定义块级作用域 2. 新增了箭头函数,箭头函数简化了函数定义的定义 3.新增了promise解决回调地狱问题 ps:回调地狱是我们异步请求服务器数据时,通过then ...
- Python 潮流周刊#73:让我们对 PyPI 温柔一点,好吗?(摘要)
本周刊由 Python猫 出品,精心筛选国内外的 250+ 信息源,为你挑选最值得分享的文章.教程.开源项目.软件工具.播客和视频.热门话题等内容.愿景:帮助所有读者精进 Python 技术,并增长职 ...
- 《这是全网最硬核redis总结,谁赞成,谁反对?》六万字大合集
<这是全网最硬核redis总结,谁赞成,谁反对?>六万字大合集 我啥都不想说了,本文章来自 "本来可以靠脸吃饭的,非得靠技术的一位小姐姐" 名字叫:"兔兔Ra ...
- Sentinel简单使用(1)
使用场景 在微服务架构中,服务之间会进行大量的调用.为了防止某个服务被过多的请求压垮,导致整个系统崩溃,就需要对流量进行控制.同时,当某个服务出现故障时,为了防止故障扩散到整个系统,需要进行熔断操作. ...
- Nuxt.js 应用中的 build:manifest 事件钩子详解
title: Nuxt.js 应用中的 build:manifest 事件钩子详解 date: 2024/10/22 updated: 2024/10/22 author: cmdragon exce ...
- Web渗透10_CSRF SSRF
1 CSRF漏洞 CSRF 跨站请求伪造(英语:Cross-site request forgery),也被称为 one-click attack 或者 session riding,通常缩写为 CS ...
- 第八届御网杯线下赛Pwn方向题解
由于最近比赛有点多,而且赶上招新,导致原本应该及时总结的比赛搁置了,总结来说还是得多练,因为时间很短像这种线下赛,一般只有几个小时,所以思路一定要清晰,我还是经验太少了,导致比赛力不从心,先鸽了~ S ...