spring:
application:
name: itemservice
datasource:
url: jdbc:mysql://106.14.219.67:3306/hmall?useUnicode=true&characterEncoding=utf8&useSSL=false
username: root
password: root
driver-class-name: com.mysql.jdbc.Driver
您需要通过设置useSSL=false显式禁用SSL,或者设置useSSL=true并为服务器证书验证提供信任库。这时我们只需要在连接数据库的url上设置:useSSL=false就可以了。
值得注意的是当usessl设置为true的时候,虽然项目可以运行,但是会发现执行的速度慢了很多,这个原因不明白,这里记录一下,以后深究。