这种事情很少会碰到,不过如果碰到的话,不妨试试
1、在linux中
如果 MySQL 正在运行,首先杀之: killall -TERM mysqld
启动 MySQL :/usr/bin/safe_mysqld --skip-grant-tables
就可以不需要密码就进入 MySQL 了。
然后就是
>use mysql
>update user set password=password("new_pass") where user="root";
>flush privileges;
重新杀 MySQL ,用正常方法启动 MySQL 。
2、在windows中
如果mysql正在运行,要先停止
执行:
mysqld --skip-grant-tables
命令
这时如果看到屏幕没反应,表示服务已启动
在一个新窗口中运行
mysql
可以不用密码登录
update user set password=password("new_pass") where user="root";
杀掉mysqld的进程
重新启动MySQL服务。

Written on 2005/04/21 by Doctor - Reads: 1359 Comments: 0

发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
昵称   密码   游客无需密码
网址   电邮   [注册]
               

验证码 不区分大小写