java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES) 问题解决

### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Could not create connection to database server. Attempted reconnect 3 times. Giving up.)] with root cause

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





解决办法----------------------


用mysqld_safe --user=mysql --skip-grant-tables --skip-networking启动mysql

mysql> update mysql.user set password=password('123456') where user='root';
mysql> flush privileges;
mysql> quit

然后在重启mysql服务 用新密码访问

你可能感兴趣的:(mysql)