终极解决办法:MySQL Access denied for u
作者:
胡萝卜须摇头玩 | 来源:发表于
2018-07-22 23:48 被阅读1次1.在cmd中,输入“services.msc”,打开服务

image.png
2.找到MySQL服务,右键查看属性

image.png
3.在“可执行文件的路径”中,“--defaults-file”前面为mysql的执行文件路径,后面为配置文件路径。复制配置路径并用记事本打开“my.ini”文件(如“C:\ProgramData\MySQL\MySQL Server 5.7\my.ini”)

image.png
4.搜索“[mysqld]”,在其下一行加上“skip-grant-tables”,保存并退出

image.png
5.重启MySQL服务

image.png
6.cd到MySQL的bin目录,依次输入以下命令并换行:
cd C:\Program Files\MySQL\MySQL Server 5.7\bin
use mysql;
update user set authentication_string=password("kris925122") where user="root";
flush privileges;

image.png
7.再次重启MySQL服务,成功。
本文标题:终极解决办法:MySQL Access denied for u
本文链接:https://www.haomeiwen.com/subject/xoarmftx.html
网友评论