MySQL_密码重置

MySQL密码重置

1、停止mysql

1)以系统管理员身份运行cmd

net stop mysql.

2)手动停止服务

 

3、切换到MySQL安装路径下:D:WAMPMySQL-5.6.36in;如果已经配了环境变量,可以不用切换了。

4、在命令行输入

mysqld -nt --skip-grant-tables

这里可能会有警告,不过可以继续运行

5、再打开一个cmd,输入

mysql -uroot -p

6Enter进入数据库。

use mysql 1)update user set password=password("123456") where user="root";//设置新密码

2)mysql5.7password列改成了authentication_string:

update mysql.user set authentication_string=password('root') where user='root' flush privileges;   //刷新权限

OK

原文地址:https://www.cnblogs.com/rychh/p/13874780.html