怎样把MySQL密码找回来?

我使用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 th
e user table'

收到一只叮咚
浏览 747回答 1
1回答

犯罪嫌疑人X

1.用系统管理员登陆系统。2.停止MySQL的服务。3.进入命令窗口,然后进入MySQL的安装目录,比如我的安装目录是c:mysql,进入C:mysqlbin4.跳过权限检查启动MySQL,c:mysqlbin>mysqld-nt --skip-grant-tables5.重新打开一个窗口 mysql 直接进入数据库。6 切换数据库 use mysql7 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 重启mysql10 mysql -uroot -p 你的新密码
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

MySQL