java.sql.SQLException

Unable to connect to any hosts due to exception: java.net.ConnectException: Connection refused: connect

Samebug tips0

We couldn't find tips for this exception.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web151

  • via Unknown by 807595,
  • via Unknown by Bruce Scott,
  • via Unknown by Bruce Scott,
  • Stack trace

    • java.sql.SQLException: Unable to connect to any hosts due to exception: java.net.ConnectException: Connection refused: connect at com.mysql.jdbc.Connection.createNewIO(Connection.java:1797) at com.mysql.jdbc.Connection.<init>(Connection.java:562) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:361) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:193) at bd.main(bd.java:12)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    linxiaolonglinxiaolong
    2 times, last one
    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    3 more bugmates