今天spring boot 项目终于写好了,打算部署在刚买的digital ocean服务器上,从github pull之后,执行:
mvn clean compile package
报错提示:
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.
at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174) ~[mysql-connector-java-8.0.18.jar:8.0.18]
第一感觉是数据库连接的问题,先把application.properties里关于databse的内容全部comment:
#spring.datasource.url=jdbc:mysql://***:3306/db_test?serverTimezone=GMT%2B8
#spring.datasource.username=root
#spring.datasource.password=password
再执行:
mvn spring-boot:run
项