java.lang.RuntimeException

Failed to connect to database

Samebug tips1

MySQL doesn't support some types of characters (such as emojis) with the utf8 encoding. You need to be on MySQL 5.5+ and force utf8mb4 (everywhere, client and server). You can do this sending the query "SET NAMES utf8mb4". Check this https://goo.gl/3E2qzg


rafaelrafael

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

Stack trace

  • java.lang.RuntimeException: Failed to connect to database at com.oltpbenchmark.api.Worker.<init>(Worker.java:86) at com.oltpbenchmark.benchmarks.tpcc.TPCCWorker.<init>(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) Caused by: 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.<init>(ConnectionImpl.java:813) at com.mysql.jdbc.JDBC4Connection.<init>(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 java.lang.reflect.Constructor.newInstance(Constructor.java:526) 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.<init>(Worker.java:82) ... 6 more

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

Unknown visitor
Unknown visitorOnce,
linxiaolonglinxiaolong
Once,
Victor_ITVictor_IT
Once,
jshakiljshakil
3 times, last one
jstrayerjstrayer
6 times, last one
149 more bugmates