将im服务设置为开启启动后,报错

CHEN 2020-11-19 702

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.(ConnectionImpl.java:456)        at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246)        at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:197)        at java.sql.DriverManager.getConnection(DriverManager.java:664)        at java.sql.DriverManager.getConnection(DriverManager.java:247)        at win.liyufan.im.DBUtil.init(DBUtil.java:86)        at io.moquette.server.Server.startServer(Server.java:228)        at io.moquette.server.Server.startServer(Server.java:220)        at io.moquette.server.Server.startServer(Server.java:204)        at io.moquette.server.Server.start(Server.java:114)        at cn.wildfirechat.server.Server.main(Server.java:15) Caused by: com.mysql.cj.exceptions.CJCommunicationsException: 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 sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)        at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)        at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105)        at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151)        at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167)        at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:91)        at com.mysql.cj.NativeSession.connect(NativeSession.java:144)        at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:956)        at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:826)        ... 11 more Caused by: java.net.ConnectException: Connection refused (Connection refused)        at java.net.PlainSocketImpl.socketConnect(Native Method)        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:476)        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:218)        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:200)        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:394)        at java.net.Socket.connect(Socket.java:606)        at com.mysql.cj.protocol.StandardSocketFactory.connect(StandardSocketFactory.java:155)        at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:65)        ... 14 more Total time for which application threads were stopped: 0.0001005 seconds, Stopping threads took: 0.0000321 seconds Total time for which application threads were stopped: 0.0000377 seconds, Stopping threads took: 0.0000246 seconds Total time for which application threads were stopped: 0.0000407 seconds, Stopping threads took: 0.0000275 seconds

上传的附件:
最新回复 (1)
  • HeavyRain 2020-11-19
    引用 2
    看日志是数据库连不上,请检查数据库配置
返回