项目启动报com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure错误

报错信息

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.15.jar:8.0.15]
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:835) ~[mysql-connector-java-8.0.15.jar:8.0.15]

报错原因

大致意思就是和数据库的通信链接失败

解决方法
1、重启mysql服务,我的是docker 所以干脆就把docker干脆重启了一下

systemctl restart docker 

2、检查配置文件中的账号密码等问题,核对配置信息

你可能感兴趣的:(报错汇总)