The last packet successfully received from the server was 3,607 milliseconds ago. The last packet s

The last packet successfully received from the server was 3,607 milliseconds ago. The last packet sent successfully to the server was 3,007 milliseconds ago

spring boot项目报以上错误解决方案:
在application.properties或application.yml配置文件中修改你的MySQL数据库连接url的配置:

  #数据库连接
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://localhost:3306/xxx?allowMutiQueries=true&characterEncoding=utf8&useSSL=false&connectTimeout=1000&socketTimeout=3000
    username: 
    password: 

如上:我的连接时间大于了我设置的配置时间(connectTimeout=1000&socketTimeout=3000),所以就会报错。
可以修改自己的配置时间或者直接不需要它,根据自身需求来。

你可能感兴趣的:(srpingboot,报错,mysql,java)