win10 压缩包安装mysql8.0.11报错:Access denied for user 'root'@'localhost'

2023-02-14,,,,

按这篇:https://blog.csdn.net/Myuhua/article/details/84792121#commentsedit

这里精简下,还有update语句中authentication_string字段如果设置自己的密码时,update受影响行就为0,必须为''才可以。

win10  mysql8.0.11版本压缩包安装,忘记密码修改步骤:

1.net stop mysql 先关闭服务

2.以管理员身份运行CMD,然后执行 mysqld --console --skip-grant-tables --shared-memory

3.新开启一个命令窗口,执行 mysql.exe -u root(可以直接执行第4步指令)

4. use mysql

5.修改密码:update user set authentication_string='' where user='root';  --分号肯定要,还有就是 authentication_string字段如果设置自己的密码时,update受影响行就为0,必须为''才可以。

6:flush privileges; --分开肯定要

7: quit;

8:net start  mysql 重启服务,Navicat就可以无密码连接成功。

win10 压缩包安装mysql8.0.11报错:Access denied for user 'root'@'localhost'的相关教程结束。

《win10 压缩包安装mysql8.0.11报错:Access denied for user 'root'@'localhost'.doc》

下载本文的Word格式文档,以方便收藏与打印。