今天在重启启动以前做的项目时候,启动服务出现了这个问题
Registered plugin: 'com.baomidou.mybatisplus.extension.plugins.PerformanceInterceptor@116cc3c4'
Registered plugin: 'AbstractSqlParserHandler(sqlParserList=null, sqlParserFilter=null)'
2021-06-15 14:35:31.185 INFO 15076 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2021-06-15 14:35:31.601 ERROR 15076 --- [ restartedMain] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Exception during pool initialization.
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.
只需要在连接数据库的url中添加上useSSL = false 即可
# mysql数据库连接
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/guli?serverTimezone=GMT%2B8&characterEncoding=utf8&useSSL=false
spring.datasource.username=root
spring.datasource.password=123456
项目启动无报错