ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Mysql忘记root密码的解决方法

Mysql忘记root密码的解决方法

原创 Linux操作系统 作者:Simon_24 时间:2010-06-29 17:06:51 0 删除 编辑
1. 在service 中停掉 mysql 的 service
2. 进入 %mysql_home%\bin 目录,执行 mysqld-nt --skip-grant-tables
3. 开一个新的命令窗口执行  mysql
4. 直接就可以登录了,然后执行以下
>use mysql
>update user set password=password("new_pass") where user="root";
>flush privileges;
>exit

5.在Task Manager 中关掉 my sql 进程。
6.启动 mysql service ,就可以用新的 root 密码访问了。

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/14670217/viewspace-666609/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2009-01-20

  • 博文量
    52
  • 访问量
    159146