Bug日志:mysql连接 java.sql.SQLException: Access denied for user ‘root’@’localhost’ (using password: YES)
使用MyBatis连接 mysql的时候,出现 错误java.sql.SQLException: Access denied for user '用户名'@'localhost' (using password: YES)
使用Navicat for mysql 之前保存的连接登录正常,通过命令行登录mysql。
输入:mysql -u 用户名 -p
,输入密码,同样出现:Access denied for user 'root'@'localhost'
这个错误。
重新输入一遍居然登录正常了。
出现这个错误的原因是密码错误
。