com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

SpringBoot启动报错

错误:

### Error querying database.  Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.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.
### The error may exist in file [F:\java\workspace\petzm-mall\petzm-user\target\classes\mapper\ConsumerMapper.xml]
### The error may involve com.petzm.mall.user.mapper.ConsumerMapper.queryById
### The error occurred while executing a query
### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.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., path=/flashBuy/getLookBackBuyList},{
     }>

解决:

因为在yml中配置数据库时ip地址错误

如果ip地址正确,请检查端口、用户名、密码是否正确

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure_第1张图片

你可能感兴趣的:(mysql,error)