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异常的更多相关文章

  1. 关于JDBC连接数据库时出现的Public Key Retrieval is not allowed错误

    问题描述 最近在学习MyBatis框架,参考官方的文档通过配置文件的方式已经实现了通过Configuration配置文件和mapper映射文件访问mysql8数据库,于是想试试不使用XML文件去构建S ...

  2. JDBC链接数据库MySQL 8.0 Public Key Retrieval is not allowed 错误的解决方法

    现象 Mybatis和Spring框架整合过程中报 com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Publ ...

  3. Jdbc连接MySQL 8时报错“MySQLNonTransientConnectionException: Public Key Retrieval is not allowed”

    一.问题 因停电检修,今天重启服务器后,再启动jboss就报错"MySQLNonTransientConnectionException: Public Key Retrieval is n ...

  4. MySQL连接提示 public key retrieval is not allowed

    使用DBeaver连接mysql数据提示public key retrieval is not allowed 修改DBeaver的驱动属性中的allowPublicKeyRetrieval

  5. Public Key Retrieval is not allowed

    链接MySQL数据库报错: 数据库连接url中添加对应属性的支持.allowPublicKeyRetrieval=true&useSSL=false url: jdbc:mysql://loc ...

  6. spring boot MySQL Public Key Retrieval is not allowed

    建议在链接url处添加对应的属性 jdbc:mysql://localhost:3306/book?allowPublicKeyRetrieval=true&useSSL=false 

  7. mysql遇到java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed

    在连接数据库的url中,加上allowPublicKeyRetrieval=true from:https://blog.csdn.net/Gushiyuta/article/details/9323 ...

  8. Nacos使用 MySQL 8.0 提示Public Key Retrieval is not allowed

    原因如下(参考官网给出的连接选项): 如果用户使用了 sha256_password 认证,密码在传输过程中必须使用 TLS 协议保护,但是如果 RSA 公钥不可用,可以使用服务器提供的公钥:可以在连 ...

  9. Mysql8- Public Key Retrieval is not allowed

    在使用 MySQL 8.0 时重启应用后提示 com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Public ...

  10. Mysql8.0 Public Key Retrieval is not allow错误的解决办法

    在使用Mysql 8.0时重启后启动项目的事后会报错com.mysql.jdbc.exceptions.jdbc4.MysqlNonTransientConnectionException: Publ ...

随机推荐

  1. 想玩Steam游戏,但配置太低?ToDesk云电脑一招搞定!

    在游戏爱好者的世界里,汇集了许多游戏大作的Steam平台无疑是一座宝库.但对于许多玩家来说,拥有一颗渴望畅玩游戏的心,却常常被低配置的电脑设备所束缚.尤其是面对硬件要求极高的3A大作时,低配置的电脑往 ...

  2. Java创建数组、赋值的四种方式,声明+创建+初始化 详解

    @ 目录 一.创建数组的四种方式 二.详解 三.数组存储的弊端 一.创建数组的四种方式 以int数据类型为例 @Test public void testNewArray() { //创建数组 //法 ...

  3. ClickHouse-查询优化

    单表查询[使用的频率高] 1.prewhere代表where Prewhere 和 where 语句的作用相同,用来过滤数据.不同之处在于 prewhere 只支持*MergeTree 族系列引擎的表 ...

  4. 文件上传日志包含详解与CTF实战

    1. 日志简介 1.1 日志介绍 日志是记录系统或应用程序运行时事件的文件.这些记录可以包括错误信息.用户活动.系统性能指标等,帮助开发者和管理员监控和排查问题. 日志通常会记录多种内容,包括: 时间 ...

  5. 探索 USB 上网模组,Air780ER 当仁不让

    今天探索的是USB上网模组,我推荐的是Air780ER模组,本文从用户实际使用的角度,解答大家对Air780ER最关心的一些问题,内容不深入探究技术细节,更多从选型.应用等非技术维度展开. 一.Air ...

  6. NOIP2023模拟9联测30 T4 金牌

    NOIP2023模拟9联测30 T4 金牌 LCA 还能 \(O(1)\)-- 思路 思路非常简单,可考试就是想歪成统计指数了-- 将一条穿过 \((x,y)\) 的路径 \((u,v)\) 分为 \ ...

  7. CF2030E MEXimize the Score 题解

    题面 假设我们将数组 \(b\) 中的元素分割成任意多个 \(k\) 的非空多集 \(S_1, S_2, \ldots, S_k\) ,其中 \(k\) 是一个任意的正整数.定义 \(b\) 的分值为 ...

  8. 关于Requests交互超时的处理方式

    拿 https://aes.cryptohack.org/ecb_oracle 这道题来做示范. 由于这个链接的本地服务器在外国,因此我们很容易就会连接超时. 如下一个脚本: import reque ...

  9. 【网关开发】Openresty使用cosocket API 发送http与tcp网络请求

    背景 为网关提供健康检查功能时需要对节点发送http或者tcp探活请求.Openresty 提供cosocket来处理非阻塞IO. 实现 跟工程结合在一起,这里简单拼接数据结构 local funct ...

  10. 浅析JVM内存结构和6大区域

    内存作为系统中重要的资源,对于系统稳定运行和高效运行起到了关键的作用,Java和C之类的语言不同,不需要开发人员来分配内存和回收内存,而是由JVM来管理对象内存的分配以及对象内存的回收(又称为垃圾回收 ...