LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1507|回复: 28

一个很棘手的问题

[复制链接]
发表于 2005-9-20 22:13:43 | 显示全部楼层 |阅读模式
我配的Debina服务器中的MySQL数据库的密码忘记了怎么办,头大,现在要用数据库没有密码了
 楼主| 发表于 2005-9-21 10:55:40 | 显示全部楼层
有人知道吗,快帮帮我
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-9-21 14:12:50 | 显示全部楼层
没有人知道吗
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-9-22 10:51:52 | 显示全部楼层
没有人一个知道吗
回复 支持 反对

使用道具 举报

发表于 2005-9-22 23:17:57 | 显示全部楼层
mysqladmin -u root password <newpassword>
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-9-23 10:29:35 | 显示全部楼层
不行呀
root@www~# mysqladmin -u root password
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: NO)'
回复 支持 反对

使用道具 举报

发表于 2005-9-23 10:32:14 | 显示全部楼层
mysqld -Sg

       -Sg|--skip-grant-tables
              This option causes the server not to use the privilege system at
              all.  This gives everyone full access to all databases! (You can
              tell a running server to start using the grant tables  again  by
              executing mysqladmin flush-privileges or mysqladmin reload.)
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-9-23 10:37:17 | 显示全部楼层
能不能讲的明白点呢,我还是有点不太懂
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-9-23 11:12:57 | 显示全部楼层
mysqld --skip-grant-tables 我运行过后现在可以进入Mysql了,可是我如何才能改原来的密码呢,还有就是我如何回到原来的状态呢,我看了现在好像不能对数据库操作
回复 支持 反对

使用道具 举报

发表于 2005-9-23 11:28:42 | 显示全部楼层
进去以后
>use mysql;
>flush privileges;
>set password for 'root'@'localhost'=password('12345');
>flush privileges;
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表