连接数据库报错:Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol(protocol is disabled

错误描述:启动tomcat报mysql错误

Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
https://www.cnblogs.com/musecho/p/15074718.html
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:78)
        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
        at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1442)
        at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1881)
Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
        at java.base/sun.security.ssl.HandshakeContext.(HandshakeContext.java:172)
        at java.base/sun.security.ssl.ClientHandshakeContext.(ClientHandshakeContext.java:98)
        at java.base/sun.security.ssl.TransportContext.kickstart(TransportContext.java:238)
        at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:444)
        at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:422)
        at com.mysql.jdbc.ExportControlled.transformSocketToSSLSocket(ExportControlled.java:188)

连接数据库报错:Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol(protocol is disabled_第1张图片

解决方案:在连接的后面加上 useSSL=false

 url: jdbc:mysql://localhost:3306/demo1?useUnicode=true&useSSL=false&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&useAffectedRows=true&allowMultiQueries=true

 

你可能感兴趣的:(数据库,tomcat,mysql,java)