java.sql.SQLException: Access denied for user ‘root’@’localhost’ (using password: YES)

tip

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

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

  • Connect to MySQL with JDBC driver
    via by Unknown author,
  • Error using latest for geSuite
    via GitHub by Kainzo
    ,
  • Mysql Tomcat java.sql.SQLException - Spring Forum
    via by Unknown author,
  • accesssing another systems databse?
    via Stack Overflow by user1741023
    ,
    • java.sql.SQLException: Access denied for user ‘root’@’localhost’ (using password: YES) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:931) at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4031) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1296) at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2338) at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2371) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2163) at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:794) 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:532) at com.mysql.jdbc.Util.handleNewInstance(Util.java:407) at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:378) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305) at java.sql.DriverManager.getConnection(DriverManager.java:620) at java.sql.DriverManager.getConnection(DriverManager.java:200) at JDBCTest.main(JDBCTest.java:14)

    Users with the same issue

    linxiaolong
    linxiaolong1 times, last one,
    Victor_IT
    Victor_IT1 times, last one,
    jshakil
    jshakil3 times, last one,
    jstrayer
    jstrayer6 times, last one,
    Unknown visitor1 times, last one,
    146 more bugmates