zoukankan      html  css  js  c++  java
  • mysql数据库无法连接(JDBC)java.net.ConnectException: Connection timed out

    数据库无法连接(JDBC)
    用户名密码正确,但是一直报错:Connection timed out
    后来知道了原因:我用的是BAE提供的云mysql数据库,对访问的IP有限制 ,所以在本机上无法连接。
    ~~~~(>_<)~~~~ 
    Communications link failure due to underlying exception: 
     
    ** BEGIN NESTED EXCEPTION ** 
     
    java.net.SocketException
    MESSAGE: java.net.ConnectException: Connection timed out: connect
     
    STACKTRACE:
     
    java.net.SocketException: java.net.ConnectException: Connection timed out: connect
    at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156)
    at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:276)
    at com.mysql.jdbc.Connection.createNewIO(Connection.java:2641)
    at com.mysql.jdbc.Connection.<init>(Connection.java:1531)
    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:185)
    at com.fei.keyword.util.JDBCUtil.<init>(JDBCUtil.java:36)
    at com.fei.keyword.util.JDBCUtil.main(JDBCUtil.java:15)
     
     
    ** END NESTED EXCEPTION **
     
     
     
    Last packet sent to the server was 684 ms ago.
    at com.mysql.jdbc.Connection.createNewIO(Connection.java:2707)
    at com.mysql.jdbc.Connection.<init>(Connection.java:1531)
    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:185)
    at com.fei.keyword.util.JDBCUtil.<init>(JDBCUtil.java:36)
    at com.fei.keyword.util.JDBCUtil.main(JDBCUtil.java:15)
     

     





  • 相关阅读:
    矩形法求积分sin cos exp
    约瑟夫环问题
    KMP算法详解
    找出float型数组的最大值和最小值,分别和第一个和最后一个元素互换
    二重指针应用
    C++学习笔记(一)
    Line学习笔记
    node2vec学习笔记
    deepwalk学习笔记
    如何保证消息不被重复消费?(如何保证消息消费时的幂等性)
  • 原文地址:https://www.cnblogs.com/feiqihang/p/3659035.html
Copyright © 2011-2022 走看看