美文网首页程序园程序员
windows下重置mysql root密码

windows下重置mysql root密码

作者: 耶也夜 | 来源:发表于2019-04-29 17:23 被阅读4次

1. 停止mysql服务器

> net stop mysql

2. 禁止使用权限表启动服务器

 mysqld --console --shared-memory --skip-grant-tables

--console:窗口模式输出日志

--shared-memory:共享内存模式启动

--skip-grant-tables:不使用权限表

3. 重新读取权限表

> mysql
mysql> flush priviables;

4. 修改密码

修改账号'root'@'localhost'的密码为12345678.

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '12345678';

5. 重启服务器

CTRL + C停止服务器。停止后,重新启动mysql服务器。

> net start mysql

6. 使用新密码登录

> mysql -u root -p
Enter password: 12345678

相关文章

网友评论

    本文标题:windows下重置mysql root密码

    本文链接:https://www.haomeiwen.com/subject/rllunqtx.html