java.lang.RuntimeException: Failed to connect to database

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: NO)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1074)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4096)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4028)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:919)
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1694)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1244)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2412)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2445)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2230)
at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:813)
at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:399)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:334)
at java.sql.DriverManager.getConnection(DriverManager.java:571)
at java.sql.DriverManager.getConnection(DriverManager.java:215)
at com.oltpbenchmark.api.BenchmarkModule.makeConnection(BenchmarkModule.java:107)
at com.oltpbenchmark.api.Worker.(Worker.java:82)
at com.oltpbenchmark.benchmarks.tpcc.TPCCWorker.(TPCCWorker.java:67)
at com.oltpbenchmark.benchmarks.tpcc.TPCCBenchmark.createTerminals(TPCCBenchmark.java:125)
at com.oltpbenchmark.benchmarks.tpcc.TPCCBenchmark.makeWorkersImpl(TPCCBenchmark.java:60)
at com.oltpbenchmark.api.BenchmarkModule.makeWorkers(BenchmarkModule.java:210)
at com.oltpbenchmark.DBWorkload.runWorkload(DBWorkload.java:698)
at com.oltpbenchmark.DBWorkload.main(DBWorkload.java:547)

Users with the same issue

Once, 2 days ago
5 times, 3 days ago
Once, 1 week ago
4 times, 1 week ago
77 times, 2 weeks ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.