修改MySQL密码

来源:互联网 发布:破解炒股软件 编辑:程序博客网 时间:2024/05/23 23:04

忘记密码真是一件尴尬的事情~~~

1.进入mysql bin目录下

2.停止mysql服务

net stop mysql

3.进入跳过密码权限

mysqld -nt --skip-grant-tables

4.打开另一个命令框,也进入mysql bin目录下

5.输入 mysql,直接进入

6.查看密码

select user,host,authentication_string from user;
authentication_string,相当于password.mysql下已经没有password字段了,修改成了这个。

7.修改密码

update mysql.user set authentication_string=password('新密码') where user='root';

8.再次查看

select user,host,authentication_string from user;

发现已经修改

9.刷新,使更改生效

flush privileges;

酱紫就完成了~~~

0 0