我使用MYSQL-FRONT这个工具更改了root用户的密码,当时是更改成功了,但是重启MySQL后发现新密码和老密码都不能登录了,数据库再也进不去了,有谁遇到过这种情况,请帮忙看下。要求不重装MySQL搞定。guanli_8@126.com我按照你的回答进行到第5步的时候mysqladmin -u root flush-privileges password "newpassword" 出现如下错误mysqladmin: unable to change password; error: 'Can't find any matching row in the user table'
1 回答

犯罪嫌疑人X
TA贡献2080条经验 获得超4个赞
1.用系统管理员登陆系统。
2.停止MySQL的服务。
3.进入命令窗口,然后进入MySQL的安装目录,比如我的安装目录是c:mysql,进入C:mysqlbin
4.跳过权限检查启动MySQL,
c:mysqlbin>mysqld-nt --skip-grant-tables
5.重新打开一个窗口 mysql 直接进入数据库。
6 切换数据库 use mysql
7 update user set password =password('newpass') where user= 'root' and host = 'localhost'
select * from user; 如果没有看到root,执行grant all pivileges on *.* to 'root'@'localhost' indentifed by '密码’;
8 flush privileges;
9 重启mysql
10 mysql -uroot -p 你的新密码
添加回答
举报
0/150
提交
取消