Access denied for user 'root'@'localhost' (using password: YES)

1.以管理员身份打开cmd,切换到MySQL的bin目录

 2.关闭MySQL服务器

net stop mysql

3.跳过输入密码的步骤mysqld --defaults-file="D:\MySQL\my.ini" --console --skip-grant-tables

(注意:文件名字与路径要与自己的吻合) 

4.重启服务器

net start mysql

5.登录MySQL服务器

mysql -u root -p
输入密码之后就能登录成功了

posted @ 2019-04-29 15:24  煦色韶光  阅读(1465)  评论(0编辑  收藏  举报