ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)最终轻松方案

1、开始菜单->控制面板->管理工具->服务,找到Mysql服务停掉。

2、右击我的电脑->管理->服务与应用->服务,找到mysql服务停掉。

3、Ctrl+Alt+Delete->启动服务管理器->服务,找到mysql服务停掉
mysql

1、找到配置文件my.ini ,然后将其打开,可以选择用记事本打开
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)最终轻松方案

2、打开后,搜索mysqld关键字。找到后,在mysqld下面添加skip-grant-tables,保存退出。

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)最终轻松方案
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)最终轻松方案

3、保存后重启mySQL

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)最终轻松方案
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)最终轻松方案
亲测有效!!!