国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Caused by: com...MySQLNonTransientConnectionException: Public Key Retrieval is not allowed 的解決辦法

這篇具有很好參考價值的文章主要介紹了Caused by: com...MySQLNonTransientConnectionException: Public Key Retrieval is not allowed 的解決辦法。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

問題概述

關(guān)于這個是在新開子工程中遇到的,本工程使用的Mysql 8.x的,拉取項目啟動時遇見問題:

“?com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Public Key Retrieval is not allowed

如下圖:

com.mysql.jdbc.exceptions.jdbc4.mysqlnontransientconnectionexception: public,Java,MySQL,Spring Boot,java,mybatis,spring,MySQL,spring boot

具體信息:

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Public Key Retrieval is not allowed
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
	at com.mysql.jdbc.Util.getInstance(Util.java:408)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:898)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:887)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:861)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:878)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:874)
	at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1777)
	at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1224)
	at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2190)
	at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2221)
	at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2016)
	at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:776)
	at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
	at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:386)
	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330)
	at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:117)
	at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:123)
	at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:365)
	at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:194)
	at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:460)
	at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:534)
	at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115)
	at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112)
	at com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean.buildSqlSessionFactory(MybatisSqlSessionFactoryBean.java:601)
	at com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean.afterPropertiesSet(MybatisSqlSessionFactoryBean.java:387)
	at com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean.getObject(MybatisSqlSessionFactoryBean.java:685)
	at com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration.sqlSessionFactory(MybatisPlusAutoConfiguration.java:166)
	at com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration$$EnhancerBySpringCGLIB$$511c01b.CGLIB$sqlSessionFactory$1(<generated>)
	at com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration$$EnhancerBySpringCGLIB$$511c01b$$FastClassBySpringCGLIB$$1b7d720f.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
	at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:361)
	at com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration$$EnhancerBySpringCGLIB$$511c01b.sqlSessionFactory(<generated>)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:579)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1250)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1099)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:312)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:251)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1065)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1424)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1326)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:312)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:205)
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:513)
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:484)
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:618)
	at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:177)
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:91)
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:318)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1344)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:312)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:205)
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:513)
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:484)
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:618)
	at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:177)
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:91)
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:318)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1344)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:312)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:760)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:868)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:752)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:388)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:327)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1246)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1234)
	at com.jsh.erp.ErpApplication.main(ErpApplication.java:22)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Public Key Retrieval is not allowed
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
	at com.mysql.jdbc.Util.getInstance(Util.java:408)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:898)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:887)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:861)
	at com.mysql.jdbc.authentication.CachingSha2PasswordPlugin.nextAuthenticationStep(CachingSha2PasswordPlugin.java:130)
	at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1775)
	... 91 common frames omitted

解決辦法

查了下官網(wǎng)的參數(shù)操作表,如下圖:

com.mysql.jdbc.exceptions.jdbc4.mysqlnontransientconnectionexception: public,Java,MySQL,Spring Boot,java,mybatis,spring,MySQL,spring boot

?意為:

如果用戶使用了 sha256_password 認證,密碼在傳輸過程中必須使用 TLS 協(xié)議保護,但是如果 RSA 公鑰不可用,可以使用服務器提供的公鑰;可以在連接中通過 ServerRSAPublicKeyFile 指定服務器的 RSA 公鑰,或者?AllowPublicKeyRetrieval=True 參數(shù)以允許客戶端從服務器獲取公鑰;但是需要注意的是 AllowPublicKeyRetrieval=True可能會導致惡意的代理通過中間人攻擊(MITM)獲取到明文密碼,所以默認是關(guān)閉的,必須顯式開啟。

根據(jù)官方的描述,只需要在數(shù)據(jù)庫的鏈接后面新增 “?allowPublicKeyRetrieval=true ” 即可解決,

內(nèi)容如下:

spring:
	datasource:
		url:
			jdbc:mysql://***.***.***.***:3306/database_name?useUnicode=true
			&characterEncoding=UTF-8
			&useSSL=false
			&serverTimezone=Asia/Shanghai
			&useSSL=false
			&allowPublicKeyRetrieval=true

再次拉起項目即可成功啟動了!??!

參考:

CSDN:【Caused by: com...MySQLNonTransientConnectionException: Public Key Retrieval is not allowed 的解決辦法】

MySQL Connection String Options: 【MySQL Connection String Options】


好了,關(guān)于?Caused by: com...MySQLNonTransientConnectionException: Public Key Retrieval is not allowed 的解決辦法 ?就寫到這兒了,如果還有什么疑問或遇到什么問題歡迎掃碼提問,也可以給我留言哦,我會一一詳細的解答的。?
歇后語:“ 共同學習,共同進步 ”,也希望大家多多關(guān)注CSND的IT社區(qū)。文章來源地址http://www.zghlxwxcb.cn/news/detail-853479.html


作? ? ? ?者: 華 ? ?仔
聯(lián)系作者: who.seek.me@java98k.vip
來? ? ? ? 源: CSDN (Chinese Software Developer Network)
原? ? ? ? 文: https://blog.csdn.net/Hello_World_QWP/article/details/127270257
版權(quán)聲明: 本文為博主原創(chuàng)文章,請在轉(zhuǎn)載時務必注明博文出處!

到了這里,關(guān)于Caused by: com...MySQLNonTransientConnectionException: Public Key Retrieval is not allowed 的解決辦法的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權(quán),不承擔相關(guān)法律責任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務器費用

相關(guān)文章

  • Public Key Retrieval is not allowed

    Public Key Retrieval is not allowed

    我在使用 DBeaver 連接本地 mysql server 的時候,連接失敗,報錯: Public Key Retrieval is not allowed 。 據(jù) https://blog.csdn.net/white0718/article/details/131790493 所講:mysql server 從 8.0 開始默認使用 caching_sha2_password 插件做密碼加密工作。 解決方案有兩種 先用某個具有權(quán)限的賬號,登錄到 mysq

    2024年04月28日
    瀏覽(17)
  • Public Key Retrieval is not allowed解決

    Public Key Retrieval is not allowed解決

    一、導致“Public Key Retrieval is not allowed”原因 當禁用 SSL/TLS 協(xié)議傳輸后,客戶端會使用服務器的公鑰進行傳輸,默認情況下客戶端不會主動去找服務器拿公鑰,進而會出現(xiàn)錯誤。 出現(xiàn) Public Key Retrieval 的場景可以概括為: 禁用 SSL/TLS 協(xié)議傳輸切當前用戶在服務器端 沒有登錄緩

    2024年01月23日
    瀏覽(22)
  • PKI(Public Key Infrastructure)公鑰基礎設施淺談

    公鑰基礎設施(PKI)是一種提供公鑰加密和數(shù)字簽名服務的系統(tǒng)或平臺,它能夠管理密鑰并提供安全服務,使得用戶可以在安全的環(huán)境下使用和管理自己的密鑰。以下是關(guān)于PKI的詳細技術(shù)闡述: 證書管理:PKI的核心組成部分是證書管理,它包括證書的生成、分發(fā)、更新和撤銷

    2024年01月21日
    瀏覽(19)
  • 解決問題:Key is invalid. You must supply a key in OpenSSH public key format

    解決問題:Key is invalid. You must supply a key in OpenSSH public key format

    背景: 我們在github上面添加秘鑰的時候,保存會出現(xiàn)這個錯誤 Key is invalid. You must supply a key in OpenSSH public key format 原因分析: 這個原因是由于我們直接用工具打開id_rsa文件,然后粘貼復制上去的,但是id_rsa文件被打開之后,格式就會發(fā)生變化,所以就會一直報錯 解決方案:

    2024年02月11日
    瀏覽(38)
  • mysql 連接出現(xiàn) Public Key Retrieval is not allowed

    在MySQL連接中出現(xiàn)“Public Key Retrieval is not allowed”錯誤,通常是因為在使用安全套接字層(SSL)連接時遇到了問題。這是因為MySQL 8.0及以上版本對安全性要求更高,特別是在使用密碼插件如 caching_sha2_password 時,默認要求加密通信,并且不允許通過不安全的方式獲取服務器的公

    2024年03月25日
    瀏覽(32)
  • Public Key Retrieval is not allowed 不允許公鑰檢索

    Public Key Retrieval is not allowed解決方法 AllowPublicKeyRetrieval=True可能允許惡意代理執(zhí)行MITM攻擊以獲取明文密碼,因此它在默認情況下為False,必須顯式啟用。 在配置mysql的url時 加上? 附 完整 url

    2024年02月15日
    瀏覽(18)
  • 解決 MySQL 連接錯誤:“Public Key Retrieval is not allowed“

    在使用 JDBC 連接 MySQL 數(shù)據(jù)庫時,可能會遇到一個常見的錯誤:“Public Key Retrieval is not allowed”。這篇博客將解釋這個錯誤的原因,并提供一種有效的解決方案。 當嘗試使用 SSL 連接到 MySQL 數(shù)據(jù)庫時,JDBC 驅(qū)動可能需要驗證服務器的身份。在這個過程中,如果未配置好 SSL 或者

    2024年02月01日
    瀏覽(17)
  • 密碼學學習筆記(九):Public-Key Encryption - 公鑰加密2

    密碼學學習筆記(九):Public-Key Encryption - 公鑰加密2

    如果我們知道??, ?? (即?? = ????) 我們可以在mod N中進行反冪運算。 比如: 我們有一個單向陷門函數(shù),非常適合加密。 ?取兩個大素數(shù),然后N = ????, 然后挑選一對??, ?? ?加密:給定???? = (??, ??) 和一條消息?? 在里面?計算密文?? : ?解密:給定一個密文??

    2024年02月13日
    瀏覽(31)
  • 解決Caused by: java.lang.IllegalStateException:

    目錄 問題描述 解決方案 1. 修改JVM的-Xss參數(shù) 2. 檢查循環(huán)繼承依賴項 3. 更新相關(guān)庫和依賴 總結(jié) 在使用Java開發(fā)Web應用程序時,我們有時會遇到? ?Caused by: java.lang.IllegalStateException? ??異常,其中包含一個關(guān)于StackOverflow錯誤的描述。這種錯誤可能會導致無法完成對Web應用程

    2024年02月03日
    瀏覽(517)
  • 【SEED Labs 2.0】Public-Key Infrastructure (PKI) Lab

    【SEED Labs 2.0】Public-Key Infrastructure (PKI) Lab

    本文為 SEED Labs 2.0 - Public-Key Infrastructure (PKI) Lab 的實驗記錄。 如今,公鑰密碼學已經(jīng)成為了安全通信的基礎。但是當通信的一方將其公鑰發(fā)送給另一方時,它會受到中間人攻擊。問題在于無法驗證公鑰的所有權(quán)——即給定公鑰及其聲稱的所有者信息。我們?nèi)绾未_保公鑰確實由

    2024年02月07日
    瀏覽(41)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包