MySQL忘记密码恢复密码的实现方法

[ 2012-09-22 16:41:32 | 作者: admin ]
字号: | |
p.s. 需要注意,新版的MySQL5.7更改密码时出现ERROR 1054 (42S22): Unknown column 'password' in 'field list'
所以更改语句替换为
update mysql.user set authentication_string=password('root') where user='root' ;



一、服务器环境

1、系统windows2003 中文企业版 sp2

2、mysql 5.1.55

3、php 5.2.17

4、IIS 6.0

二、破解过程

1、停止mysql服务(以管理员身份,在cmd命令行下运行)使用如下命令:
net stop mysql


attachments/201209/22_164341_.jpg


  2、.使用命令启动mysql数据库,命令如下

mysqld - -skip-grant-tables


attachments/201209/22_164416_.jpg


3.新开一个cmd窗口,进行如下命令操作

1、mysql -uroot
2、
update mysql.user set password=password('你的密码') where user='root;

如图:

attachments/201209/22_164457_.jpg



4、打开任务管理器,停止mysql,mysqld进程,使用net start mysql启动mysqld服务,就可以使用root用户 root密码进入数据库了(这步可以省略重启机器)
[最后修改由 admin, 于 2020-05-09 19:20:11]
评论Feed 评论Feed: http://blog.xg98.com/feed.asp?q=comment&id=1879

这篇日志没有评论。

此日志不可发表评论。