(已解决)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 ...
随机推荐
- 封装大屏组件 screenfull
错误场景:使用大屏插件 screenFull 报错:in ./node_modules/screenfull/index.js Module parse failed: Unexpected tok ...
- 小程序的三大API
小程序的API有宿主环境提供的 : ps:浏览器的定义对象是 window 而微信中的顶级对象是wx :都是不用声明就能调用 : 1. 事件监听 以on开头,监听事件的触发 eg:onWindowRe ...
- HRM平台的登录页的背景图片- scss
.login-container { // 设置背景图片 background-image: url("~@/assets/common/login.jpg"); ba ...
- day03-了解ajax
Ajax Ajax即Asynchronous Javascript And XML(异步JavaScript和XML). Ajax是一种在无需重新加载整个网页的情况下,能够更新部分网页的技术,这使得程 ...
- 6.19 成都站云原生 Meetup,KubeSphere 和 APISIX 等你来!
以容器技术和容器编排为基础的云原生应用,被越来越多的企业用户接受和使用,并且在生产环境中使用容器技术的比例逐年增加.KubeSphere 作为一款面向应用的开源容器混合云,经过 3 年的发展和 10 ...
- Web渗透05_SQL注入(TOP 1漏洞)
SQL注入是所有WEB漏洞中最危险的攻击方式,带来的危害也是最大的.没有之一. SQL注入基础 在编写web应用时,几乎所有的数据都存储在网站的数据库中,你的账号信息,收藏信息,文章信息等等数据都存在 ...
- springboot-实现excle文件导出的单元格相同内容合并
导出excle文件中的单元格有些需要合并如何操作 例如:左边的表格想合并单元格成右边的表格更加便于观看 一.依赖文件 <!-- excle操作--> <depen ...
- mysql临时启动不了的问题处理。
getenforce SELinux状态 setenforce 0 临时关闭SELinux 然后启动mysql就能成功
- ext 库及 pb_ds 在 OI 中的应用
ext 库在 OI 中的应用 写一个帖子,防止以后忘了. pb_ds 部分 pb_ds 万能头 #include<bits/extc++.h> 来包含 ext 库中所有的头文件(例如 pb ...
- nginx配置php-fpm虚拟主机站点
ubuntu下安装nginx 很简单 sudo apt-get install nginx 然后安装php-fpm 我这本地php7.4所以这么写 sudo apt search php7.4-fpm ...