mysql5.0忘记ROOT密码解决办法

作者: mikj 分类: mysql 发布时间: 2010-06-24 05:17 ė 6没有评论

支行cmd 转到MySQL 的bin 目录下

<li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><span><span>bin</span><span>&gt;</span></span>MySQL<span><span>d-nt.exe&nbsp;--skip-grant-tables&nbsp;&amp;&nbsp;&nbsp;</span></span></li>

打开新命令窗口

<li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><span><span>bin</span><span>&gt;</span></span>MySQL<span><span>&nbsp;-u&nbsp;root&nbsp; &nbsp;</span></span></li>
<li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">MySQL<span>&gt;</span><span>&nbsp;update&nbsp;</span>MySQL<span>.user&nbsp;set&nbsp;</span><span>password</span><span>=</span>PASSWORD<span>(’新密码’)&nbsp;where&nbsp;</span><span>User</span><span>=’root’;&nbsp; &nbsp;</span></li>
<li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">MySQL<span>&gt;</span><span>&nbsp;flush&nbsp;privileges;&nbsp; &nbsp;</span></li>
<li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">MySQL<span>&gt;</span><span>&nbsp;quit&nbsp;&nbsp;</span></li>

1.在命令中将目录指定到MySQL下的bin目录,输入命令:MySQLd-nt.exe –skip-grant-tables &

此操作的目的是跳过权限检查表

2.在命令行中输入命令:MySQL -u root

此操作的目的是以MySQL root密码用户登入,登入成功后显示登入成功的信息,就可以继续下一步了

3.在命令行中输入命令:update MySQL.user set password=PASSWORD(’新密码’) where User=’root’;

此操作的目的是更改root用户的密码

4.在命令行中输入:flush privileges;

本文出自 小沨的天空,转载时请注明出处及相应链接。

本文永久链接: http://www.xiaofengsky.com/65001.html

发表评论

电子邮件地址不会被公开。 必填项已用*标注

You must enable javascript to see captcha here!

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Ɣ回顶部