java.sql.SQLException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'localhost' (using password: YES))

GitHub | michaelruocco | 7 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Cannot run as root user with non blank password

    GitHub | 7 months ago | michaelruocco
    java.sql.SQLException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'localhost' (using password: YES))

    1 unregistered visitors

    Root Cause Analysis

    1. java.sql.SQLException

      Access denied for user 'root'@'localhost' (using password: YES)

      at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException()
    2. com.mysql.cj
      NonRegisteringDriver.connect
      1. com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:695)
      2. com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:663)
      3. com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:653)
      4. com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:115)
      5. com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:1663)
      6. com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:662)
      7. com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:352)
      8. com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:221)
      8 frames
    3. Apache Commons DBCP
      BasicDataSource.getConnection
      1. org.apache.commons.dbcp2.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:39)
      2. org.apache.commons.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:256)
      3. org.apache.commons.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:2304)
      4. org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2290)
      5. org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2039)
      6. org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1533)
      6 frames
    4. uk.co.tpplc
      PasswordTest.shouldConnectWithRootUserAndPassword
      1. uk.co.tpplc.PasswordTest.testConnection(PasswordTest.java:60)
      2. uk.co.tpplc.PasswordTest.shouldConnectWithRootUserAndPassword(PasswordTest.java:35)
      2 frames
    5. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:497)
      4 frames
    6. JUnit
      JUnitCore.run
      1. org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
      2. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      3. org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
      4. org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      5. org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
      6. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
      7. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      8. org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      9. org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      10. org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      11. org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      12. org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      13. org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      14. org.junit.runner.JUnitCore.run(JUnitCore.java:160)
      14 frames
    7. IntelliJ junit4 module
      JUnit4IdeaTestRunner.startRunnerWithArgs
      1. com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:117)
      2. com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)
      2 frames
    8. IDEA
      JUnitStarter.main
      1. com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:253)
      2. com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:84)
      2 frames
    9. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:497)
      4 frames
    10. IDEA
      AppMain.main
      1. com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
      1 frame