读写分离连接主从库后报错:javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or..

问题演示:

        就是当我们springboot项目连接完主从库后,然后启动项目的时候项目会报如下的错误信息:

com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure.
 
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
 
Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)

解决报错问题:

        首先我们找到jdk中的该java.security文件:

读写分离连接主从库后报错:javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or.._第1张图片

 

如果能打开的话就把下面框起来的删除掉即可:

 

如果打不开该文件或者打开该文件后该文件中没有任何数据的时候,那么我们就在项目application.yml属性里配置数据源时添加上 &useSSL=false即可解决报错问题:

读写分离连接主从库后报错:javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or.._第2张图片

 

最终就会发现项目能够启动成功了:

读写分离连接主从库后报错:javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or.._第3张图片

 

你可能感兴趣的:(笔记,java,数据库,服务器)