Java connect to the database always being given

mysql account password is correct, but has been reported to account password.

Error message:

java.sql.SQLException: User Access denied for 'the root' @ 'localhost' (the using password: YES)
AT com.mysql.jdbc.SQLError.createSQLException (SQLError.java:964) ~ [MySQL-Connector-Java-5.1. 42.jar: 5.1.42]
AT com.mysql.jdbc.MysqlIO.checkErrorPacket (MysqlIO.java:3973) ~ [MySQL-Connector-Java-5.1.42.jar: 5.1.42]
The reason is that
if the password is zero at the beginning of then it will be automatically removed 0 it will fail.
solve:

  1. change Password
  2. Single quotation marks: 'password'
Published 53 original articles · won praise 5 · Views 8283

Guess you like

Origin blog.csdn.net/weixin_44494373/article/details/103956630