数据库配置信息为:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.56.10:3306/gulimall_admin?useUnicode=true&characterEncoding=UTF-8
username: root
password: root
报错关键信息如下:
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版本导致SSL调用权限上有问题,我使用的是JDK1.8.0_333, 在C:\Program Files\Java\jre里面的lib\security 下面有个java.security:
解决方法:
1.删除掉该文件里的 SSLv3(删掉SSLv3就是允许SSL调用).
2.application.yml里配置数据源时添加上 &useSSL=false.