找文章 / 找答案
精选问答 更多内容

mysql数据库无法连接

xxx404铂金四 显示全部楼层 发表于 2022-9-9 10:28:04 |阅读模式 打印 上一主题 下一主题
1
未解决

mysql数据库无法连接

  • xxx404铂金四
  • 2022-09-09 10:28:04
  • 发布在 论坛
2096 7
这是报错代码
  1. 无法连接数据库,具体原因:“Communications link failure
  2. The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.”。]
  3. g5.util.RTWrappedException: 无法连接数据库,具体原因:“Communications link failure
  4. The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.”。
  5.         at g5.qry.sql.impl.SQLConnBuilder.build0(SQLConnBuilder.java:75) ~[product-20220506.jar:?]
  6.         at g5.qry.sql.impl.JDBCConnBuilder.build(JDBCConnBuilder.java:66) ~[product-20220506.jar:?]
  7.         at jdk.internal.reflect.GeneratedMethodAccessor7160.invoke(Unknown Source) ~[?:?]
  8.         at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
  9.         at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
  10.         at g5.qry.driver.ConnectionProvider.getConn(ConnectionProvider.java:99) ~[product-20220506.jar:?]
  11.         at g5.sv.qry.req.TestQryReq$CreateConnRunable.run(TestQryReq.java:254) ~[product-20220506.jar:?]
  12.         at g5.thread.ThreadPoolWithChecker$GThread.run0(ThreadPoolWithChecker.java:214) ~[product-20220506.jar:?]
  13.         at g5.thread.AbsThreadPool$PThread.run(AbsThreadPool.java:319) ~[product-20220506.jar:?]
  14. Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
  15. The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
  16.         at jdk.internal.reflect.GeneratedConstructorAccessor658.newInstance(Unknown Source) ~[?:?]
  17.         at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
  18.         at java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[?:?]
  19.         at com.mysql.jdbc.Util.handleNewInstance(Util.java:404) ~[mysql-connector-java-5.1.39-bin.jar:5.1.39]
  20.         at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:988) ~[mysql-connector-java-5.1.39-bin.jar:5.1.39]
  21.         at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:341) ~[mysql-connector-java-5.1.39-bin.jar:5.1.39]
  22.         at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2251) ~[mysql-connector-java-5.1.39-bin.jar:5.1.39]
  23.         at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2284) ~[mysql-connector-java-5.1.39-bin.jar:5.1.39]
  24.         at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2083) ~[mysql-connector-java-5.1.39-bin.jar:5.1.39]
  25.         at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:806) ~[mysql-connector-java-5.1.39-bin.jar:5.1.39]
  26.         at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47) ~[mysql-connector-java-5.1.39-bin.jar:5.1.39]
  27.         at jdk.internal.reflect.GeneratedConstructorAccessor37.newInstance(Unknown Source) ~[?:?]
  28.         at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
  29.         at java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[?:?]
  30.         at com.mysql.jdbc.Util.handleNewInstance(Util.java:404) ~[mysql-connector-java-5.1.39-bin.jar:5.1.39]
  31.         at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:410) ~[mysql-connector-java-5.1.39-bin.jar:5.1.39]
  32.         at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:328) ~[mysql-connector-java-5.1.39-bin.jar:5.1.39]
  33.         at java.sql.DriverManager.getConnection(DriverManager.java:677) ~[java.sql:?]
  34.         at java.sql.DriverManager.getConnection(DriverManager.java:189) ~[java.sql:?]
  35.         at g5.qry.sql.impl.SQLConnBuilder.build0(SQLConnBuilder.java:70) ~[product-20220506.jar:?]
  36.         ... 8 more
  37. Caused by: java.net.ConnectException: Connection refused (Connection refused)
  38.         at java.net.PlainSocketImpl.socketConnect(Native Method) ~[?:?]
  39.         at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399) ~[?:?]
  40.         at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242) ~[?:?]
  41.         at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224) ~[?:?]
  42.         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:403) ~[?:?]
  43.         at java.net.Socket.connect(Socket.java:591) ~[?:?]
  44.         at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:211) ~[mysql-connector-java-5.1.39-bin.jar:5.1.39]
  45.         at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:300) ~[mysql-connector-java-5.1.39-bin.jar:5.1.39]
  46.         at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2251) ~[mysql-connector-java-5.1.39-bin.jar:5.1.39]
  47.         at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2284) ~[mysql-connector-java-5.1.39-bin.jar:5.1.39]
  48.         at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2083) ~[mysql-connector-java-5.1.39-bin.jar:5.1.39]
  49.         at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:806) ~[mysql-connector-java-5.1.39-bin.jar:5.1.39]
  50.         at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47) ~[mysql-connector-java-5.1.39-bin.jar:5.1.39]
  51.         at jdk.internal.reflect.GeneratedConstructorAccessor37.newInstance(Unknown Source) ~[?:?]
  52.         at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
  53.         at java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[?:?]
  54.         at com.mysql.jdbc.Util.handleNewInstance(Util.java:404) ~[mysql-connector-java-5.1.39-bin.jar:5.1.39]
  55.         at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:410) ~[mysql-connector-java-5.1.39-bin.jar:5.1.39]
  56.         at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:328) ~[mysql-connector-java-5.1.39-bin.jar:5.1.39]
  57.         at java.sql.DriverManager.getConnection(DriverManager.java:677) ~[java.sql:?]
  58.         at java.sql.DriverManager.getConnection(DriverManager.java:189) ~[java.sql:?]
  59.         at g5.qry.sql.impl.SQLConnBuilder.build0(SQLConnBuilder.java:70) ~[product-20220506.jar:?]
  60.         ... 8 more
复制代码


回复

使用道具 举报

精彩评论7

yhdata_yzm 显示全部楼层 发表于 2022-9-9 10:49:26
创建数据源报错吗
回复

使用道具 举报

xxx404铂金四 显示全部楼层 发表于 2022-9-9 10:50:13
yhdata_yzm 发表于 2022-9-9 10:49
创建数据源报错吗

是测试连接
回复

使用道具 举报

xxx404铂金四 显示全部楼层 发表于 2022-9-9 10:50:25
yhdata_yzm 发表于 2022-9-9 10:49
创建数据源报错吗

数据库版本是5.7.38应该是有兼容性的吧
回复

使用道具 举报

yhdata_lyaa 显示全部楼层 发表于 2022-9-9 11:02:38
第三方软件可以连上数据库吗,按照这个也排查下https://club.yonghongtech.com/thread-10238-1-1.html
回复

使用道具 举报

xxx404铂金四 显示全部楼层 发表于 2022-9-9 11:14:22
yhdata_lyaa 发表于 2022-9-9 11:02
第三方软件可以连上数据库吗,按照这个也排查下https://club.yonghongtech.com/thread-10238-1-1.html ...

上面的报错都和我的不符合。。。
回复

使用道具 举报

xxx404铂金四 显示全部楼层 发表于 2022-9-9 11:16:28
yhdata_lyaa 发表于 2022-9-9 11:02
第三方软件可以连上数据库吗,按照这个也排查下https://club.yonghongtech.com/thread-10238-1-1.html ...

按照url加autoReconnect=true设置报错是这个

  1. 无法连接数据库,具体原因:“Could not create connection to database server. Attempted reconnect 3 times. Giving up.”。Communications link failure

  2. The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.Connection refused (Connection refused)
复制代码
回复

使用道具 举报

yhdata_bear 显示全部楼层 发表于 2022-9-9 13:52:41
回复

使用道具 举报

高级模式
您需要登录后才可以回帖 登录 | 免费注册

  • 官方微信

    欢迎关注永洪服务号!收费为0,价值无限

    扫码关注
  • 新浪微博

    让每位用户轻松挖掘数据价值!

    访问新浪微博
  • 智能客服
50W

会员等你来哦

Copyright   ©2012-2024  北京永洪商智科技有限公司  (京ICP备12050607) 京公网安备110110802011451号 |《永洪社区协议》
返回顶部