最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Mysql數(shù)據(jù)庫連接失敗SSLException: Unsupported record version Unknown-0.0問題

 更新時間:2024年06月06日 10:24:19   作者:chgiser  
這篇文章主要介紹了Mysql數(shù)據(jù)庫連接失敗SSLException: Unsupported record version Unknown-0.0問題,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教

問題描述

  • mysql版本:5.7.27
  • jdk版本:1.8.0_201

tomcat日志中報錯,顯示連接數(shù)據(jù)庫失敗,報錯信息如下:

The last packet successfully received from the server was 152 milliseconds ago.  The last packet sent successfully to the server was 147 milliseconds ago.
    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:404)
    at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:981)
    at com.mysql.jdbc.ExportControlled.transformSocketToSSLSocket(ExportControlled.java:164)
    ... 89 more
Caused by: javax.net.ssl.SSLException: Unsupported record version Unknown-0.0
    at sun.security.ssl.InputRecord.checkRecordVersion(InputRecord.java:552)
    at sun.security.ssl.InputRecord.readV3Record(InputRecord.java:565)
    at sun.security.ssl.InputRecord.read(InputRecord.java:529)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:975)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1367)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1395)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1379)
    at com.mysql.jdbc.ExportControlled.transformSocketToSSLSocket(ExportControlled.java:149)
    ... 89 more
Mon Dec 09 13:15:02 CST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
2019-12-09 13:15:02,494 ERROR [com.alibaba.druid.pool.DruidDataSource] - <create connection error, url: jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&zeroDateTimeBehavior=convertToNull&characterEncoding=UTF-8, errorCode 0, state 08S01>
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

解決方法

顯示配置數(shù)據(jù)庫連接地址useSSL=false,如

jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&zeroDateTimeBehavior=convertToNull&characterEncoding=UTF-8&useSSL=false

問題延伸

另一種比較麻煩的問題是geoserver也出現(xiàn)了類似連接mysql異常的問題,

報錯信息如下:

ERROR [geoserver.ows] - 
java.lang.RuntimeException: Error getting FeatureType, this should never happen!
    at org.geoserver.wms.map.GetMapKvpRequestReader.checkStyle(GetMapKvpRequestReader.java:1218)
    at org.geoserver.wms.map.GetMapKvpRequestReader.read(GetMapKvpRequestReader.java:566)
    ... 100 more
Caused by: java.io.IOException
    at org.geoserver.catalog.ResourcePool.getDataStore(ResourcePool.java:632)
    at org.geoserver.catalog.ResourcePool.getCacheableFeatureType(ResourcePool.java:916)
    at org.geoserver.catalog.ResourcePool.tryGetFeatureType(ResourcePool.java:901)
    at org.geoserver.catalog.ResourcePool.getFeatureType(ResourcePool.java:893)
    at org.geoserver.catalog.ResourcePool.getFeatureType(ResourcePool.java:878)
    ... 111 more
Caused by: java.lang.RuntimeException: Unable to obtain connection: Cannot create PoolableConnectionFactory (Communications link failure

The last packet successfully received from the server was 2 milliseconds ago.  The last packet sent successfully to the server was 2 milliseconds ago.)
    at org.geotools.jdbc.JDBCDataStore.createConnection(JDBCDataStore.java:2186)
    at org.geotools.jdbc.JDBCDataStore.createTypeNames(JDBCDataStore.java:978)
    at org.geotools.data.store.ContentDataStore.getTypeNames(ContentDataStore.java:259)
    at org.vfny.geoserver.util.DataStoreUtils.getDataAccess(DataStoreUtils.java:88)
    at org.geoserver.catalog.ResourcePool.getDataStore(ResourcePool.java:591)
    ... 115 more
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failure

The last packet successfully received from the server was 2 milliseconds ago.  The last packet sent successfully to the server was 2 milliseconds ago.)
    at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
    at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
    at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
    at org.geotools.data.jdbc.datasource.AbstractManageableDataSource.getConnection(AbstractManageableDataSource.java:41)
    at org.geotools.jdbc.JDBCDataStore.createConnection(JDBCDataStore.java:2170)
    ... 119 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 2 milliseconds ago.  The last packet sent successfully to the server was 2 milliseconds ago.
    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.SQLError.createCommunicationsException(SQLError.java:990)
    ... 143 more
Caused by: javax.net.ssl.SSLException: Unsupported record version Unknown-0.0
    at sun.security.ssl.InputRecord.checkRecordVersion(InputRecord.java:552)
    at sun.security.ssl.InputRecord.readV3Record(InputRecord.java:565)
    at sun.security.ssl.InputRecord.read(InputRecord.java:529)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:975)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1367)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1395)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1379)
    at com.mysql.jdbc.ExportControlled.transformSocketToSSLSocket(ExportControlled.java:186)
    ... 142 more

查找了geoserver中mysql插件的相關(guān)配置項,沒有找到設(shè)置SSL連接的屬性,在不修改geoserver源碼的情況下,只能修改mysql的ssl配置來修復(fù)了,

在mysql的配置文件my.cnf中加上一行:

# disable_ssl
skip_ssl

重啟MySQL:

service mysqld restart

再查看SSL的開啟狀態(tài):

SHOW VARIABLES LIKE '%ssl%';

看到have_ssl的值為DISABLED,表示已關(guān)閉SSL。

總結(jié)

以上為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持腳本之家。

相關(guān)文章

  • 一鍵安裝mysql5.7及密碼策略修改方法

    一鍵安裝mysql5.7及密碼策略修改方法

    這篇文章主要介紹了一鍵安裝mysql5.7及密碼策略修改方法,非常不錯,具有一定的參考借鑒價值,需要的朋友可以參考下
    2018-10-10
  • 利用 MySQL 進(jìn)行數(shù)據(jù)清洗的操作方法

    利用 MySQL 進(jìn)行數(shù)據(jù)清洗的操作方法

    本文給大家介紹利用MySQL進(jìn)行數(shù)據(jù)清洗的操作方法,下面給大家分享常見的數(shù)據(jù)清洗操作及對應(yīng)SQL示例,感興趣的朋友一起看看吧
    2025-07-07
  • MySQL 游標(biāo)的定義與使用方式

    MySQL 游標(biāo)的定義與使用方式

    這篇文章主要介紹了MySQL 游標(biāo)的定義與使用方式,幫助大家更好的理解和使用MySQL,感興趣的朋友可以了解下
    2021-01-01
  • mysql日志系統(tǒng)的簡單使用教程

    mysql日志系統(tǒng)的簡單使用教程

    這篇文章主要給大家介紹了關(guān)于mysql日志系統(tǒng)的簡單使用,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2021-03-03
  • MySQL怎么給字符串字段加索引

    MySQL怎么給字符串字段加索引

    本文主要介紹了MySQL怎么給字符串字段加索引,文中通過示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2022-03-03
  • 一文了解Mysql分區(qū)的使用

    一文了解Mysql分區(qū)的使用

    分區(qū)允許根據(jù)可以設(shè)置為任意大小的規(guī)則,跨文件系統(tǒng)分配單個表的多個部分,本文主要介紹了Mysql分區(qū)的使用,具有一定的參考價值,感興趣的可以了解一下
    2024-06-06
  • 數(shù)據(jù)庫索引知識點(diǎn)整理

    數(shù)據(jù)庫索引知識點(diǎn)整理

    這篇文章主要介紹了數(shù)據(jù)庫索引知識點(diǎn)整理,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考
    2021-01-01
  • mysql 設(shè)置自動創(chuàng)建時間及修改時間的方法示例

    mysql 設(shè)置自動創(chuàng)建時間及修改時間的方法示例

    這篇文章主要介紹了mysql 設(shè)置自動創(chuàng)建時間及修改時間的方法,結(jié)合實例形式分析了mysql針對創(chuàng)建時間及修改時間相關(guān)操作技巧,需要的朋友可以參考下
    2019-09-09
  • Mysql案例之GROUP_CONCAT函數(shù)的具體使用

    Mysql案例之GROUP_CONCAT函數(shù)的具體使用

    本文詳細(xì)的介紹了MySQL中學(xué)生與學(xué)科多對多關(guān)聯(lián)場景下的排序問題,通過GROUP_CONCAT函數(shù)結(jié)合左連接和分組,一次性獲取每個學(xué)生首個學(xué)科名稱并排序,感興趣的可以了解一下
    2025-05-05
  • Mysql中的觸發(fā)器簡單介紹及使用案例

    Mysql中的觸發(fā)器簡單介紹及使用案例

    觸發(fā)器可以監(jiān)聽著數(shù)據(jù)表的某個行為,一旦數(shù)據(jù)表的這個行為發(fā)生了,馬上執(zhí)行相應(yīng)的sql語句,下面有個不錯的案例大家可以研究下
    2013-12-12

最新評論

韶关市| 原阳县| 洪洞县| 怀宁县| 霍州市| 昂仁县| 枣庄市| 保康县| 封开县| 辽宁省| 会同县| 台东县| 湖南省| 石棉县| 太和县| 宁远县| 荃湾区| 青岛市| 禄丰县| 连城县| 永和县| 稷山县| 贵德县| 柯坪县| 蒙山县| 兰坪| 太白县| 钦州市| 舞钢市| 灵山县| 黄山市| 霸州市| 叶城县| 余姚市| 蒲城县| 达州市| 建昌县| 石棉县| 东丰县| 太康县| 顺平县|