navicat连接MySQL报错:1045 - Access denied for user ‘root’@‘localhost’ (using password: YES)
问题:很久没有使用数据库了,突然使用出现了报错”1045 - Access denied for user ‘root’@‘localhost’ (using password: YES)“
解决办法
1.重启mysql
在命令行输入
停止:net stop mysql
启动: net start mysql
2.进入mysql客户端
这个时候在cmd里面输入mysql -u root -p就可以不用密码登录了,出现 password:的时候直接回车可以进入
3.进入mysql数据库,重新设置密码
alter user 'root'@' localhost' identified by '123456'
by + 修改的密码
然后重新链接就好了!