mysql errorCode 0, state 08S01
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)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:836)
at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:456)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:197)
at com.p6spy.engine.spy.P6SpyDriver.connect(P6SpyDriver.java:102)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1644)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1710)
at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2753)
Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure
将mysql连接信息修改
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
name: dbSeckill
//url: jdbc:mysql//localhost:3306/dbSeckill?useUnicode=true&characterEncoding=UTF-8&serverTimezone=
Asia/Shanghai
url: jdbc:mysql//localhost:3306/dbSeckill?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT
username:
password:
type: com.alibaba.druid.pool.DruidDataSource