Error code 1045, state 28000, Java sql.SQLException :Access denied for user ‘root’@’localhost’

Using druid to connect to MySQL and report errors: errorcode 1045, state 28000, Java sql.SQLException :Access denied for user ‘root’@’localhost’ using password:yes

At first, we checked the account password or permissions. However, we found that all the configurations were correct. As a result, we found that db.properties There are a few more spaces in the user and password , for a long time, take warning, later configuration must pay attention to the space

Read More: