紧急求助 MYSQL 修改密码后登陆不上去!

t240034137 2010-05-06 03:00:00
mysql> use mysql;
Database changed
mysql> update user set password='master' where user='root';
Query OK, 3 rows affected (0.05 sec)
Rows matched: 3 Changed: 3 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.16 sec)


然后我用新的密码登陆 死活也登陆不上去! 求助!
...全文
1087 18 打赏 收藏 转发到动态 举报
写回复
用AI写文章
18 条回复
切换为时间正序
请发表友善的回复…
发表回复
hansirXu 2011-10-15
  • 打赏
  • 举报
回复
6楼的方法真的很好用,我试过了,解决了问题,在此对六楼表示感谢
t240034137 2010-05-06
  • 打赏
  • 举报
回复
谢谢大神们!现在真是豁然开朗了!。。。心中石头放下了!
t240034137 2010-05-06
  • 打赏
  • 举报
回复
好了!哎 不知道是什么问题 咋就又好了!。。。郁闷ING 
t240034137 2010-05-06
  • 打赏
  • 举报
回复
D:\www\MySQL5.1\bin>mysqld-nt --defaults-file="D:\www\MySQL5.1\my.ini" --consol
100506 15:41:07 InnoDB: Started; log sequence number 0 46489
100506 15:41:07 [Warning] Found invalid password for user: 'root@localhost'; Ign
oring user
100506 15:41:07 [Warning] Found invalid password for user: 'root@production'; Ig
noring user
100506 15:41:07 [Warning] Found invalid password for user: 'root@127.0.0.1'; Ign
oring user
100506 15:41:07 [ERROR] Column count of mysql.event is wrong. Expected 22, found
18. Created with MySQL 50120, now running 50128. Please use mysql_upgrade to fi
x this error.
100506 15:41:07 [ERROR] Event Scheduler: An error occurred when initializing sys
tem tables. Disabling the Event Scheduler.
100506 15:41:07 [Note] mysqld-nt: ready for connections.
Version: '5.1.28-rc-community' socket: '' port: 3306 MySQL Community Server (
GPL)


ACMAIN_CHM 2010-05-06
  • 打赏
  • 举报
回复
[Quote]但是好像有东西连接到MYSQL上了 还报错![/Quote]报什么错?

问题说明越详细,回答也会越准确!参见如何提问。(提问的智慧
t240034137 2010-05-06
  • 打赏
  • 举报
回复
刚才找到问题了!用
D:\www\MySQL5.1\bin>mysqld-nt --defaults-file="D:\www\MySQL5.1\my.ini" --consol
--skip-grant-tables
但是好像有东西连接到MYSQL上了 还报错!
ACMAIN_CHM 2010-05-06
  • 打赏
  • 举报
回复
[Quote]mysqld 命令不存在 又悲剧了![/Quote]

有些版本中是mysqld-nt.exe
t240034137 2010-05-06
  • 打赏
  • 举报
回复
mysqld 命令不存在 又悲剧了!
zhoujin4500 2010-05-06
  • 打赏
  • 举报
回复
楼上方法很正确,照着做就行。
t240034137 2010-05-06
  • 打赏
  • 举报
回复
我在window下执行程序 进入安全模式 就不行了 停在那边!
/MySQL/bin/mysqld-nt.exe --skip-grant-tables
t240034137 2010-05-06
  • 打赏
  • 举报
回复
我试试!谢谢你呀!
vipper23 2010-05-06
  • 打赏
  • 举报
回复
1、首先停止正在运行的MySQL进程

Linux下,运行
1 killall -TERM mysqld


Windows下,如果写成服务的 可以运行:
1 net stop mysql


,如未加载为服务,可直接在进程管理器中进行关闭。

2、以安全模式启动MySQL

Linux下,运行
1 mysqld_safe --skip-grant-tables &


Windows下,在命令行下运行
1 X:/MySQL/bin/mysqld-nt.exe --skip-grant-tables


3、完成以后就可以不用密码进入MySQL了

Linux下,运行
1 mysql -u root -p


进入
Windows下,运行
1 X:/MySQL/bin/mysql -u root -p


进入

4、更改密码
123 >use mysql
>update user set password=password("新密码") where user="root";
>flush privileges;


t240034137 2010-05-06
  • 打赏
  • 举报
回复
那怎么办呀? 这不就是宣判我死刑了?
t240034137 2010-05-06
  • 打赏
  • 举报
回复
我是用那个密码登陆的呀 但是没用的!
t240034137 2010-05-06
  • 打赏
  • 举报
回复
提示:
D:\www\MySQL5.1\bin>mysql -uroot -p
Enter password: ******
ERROR 1130 (HY000): Host 'localhost' is not allowed to connect to this MySQL ser
ver

完了 搞大了! 大神们帮帮我!
vipper23 2010-05-06
  • 打赏
  • 举报
回复
password是加密过的,应该是
update user set password=password('master') where user='root';

这样就可以用master这个密码登录。。。
t240034137 2010-05-06
  • 打赏
  • 举报
回复
现在数据库 完全被锁住! 要命了!急死我了!

56,687

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧