1

mysql 重置root密码

myini文件增加命令

 

(1)在my.ini文件的[mysqld]块下增加“skip_grant_tables”,然后重启mysql服务,再以管理员权限打开cmd执行一些列命令重置密码

 

 

mysql> use mysql;
Database changed
mysql> update user set authentication_string=password('***') where user='root' and Host='localhost';

Query OK, 1 row affected, 1 warning (0.00 sec)

 

 

改完之后 把ini文件的skip那个删掉

 

 

登录之后报错

 

You must reset your password using ALTER USER statement before executing this statement.

 

通过命令 :


SET PASSWORD = PASSWORD('xxxxx')

 

posted @ 2019-05-26 10:24  萌哥-爱学习  阅读(170)  评论(0编辑  收藏  举报