tolab

1.运行cmd, 输入Net start 查看MySQL服务名称,如果找不到MySQL开头,直接执行第3步

2.停止MySQL服务, CMD中输入net stop MySQL57 (MySQL57是MySQL服务名)

3.找到MySQL配置文件my.ini (一般在%ProgramData%\MyQL

 4.在my.ini [mysqld] 下加入 skip-grant-tables ( - 换成 _ 也可)

 5.连接数据库,不用密码或任意密码,找到mysql数据库,user表,将root改为你想要的密码,注意用password函数加密。

update user

set authentication_string=password(\'123456\') where user=\'root\';

 6.将my.ini 的 skip-grant-tables 删除,重启MySQL服务

分类:

技术点:

相关文章: