LinuxSir.cn,穿越时空的Linuxsir!

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

如何设置mysql的超级用户root的密码?

[复制链接]
发表于 2003-12-5 08:37:52 | 显示全部楼层 |阅读模式
我装的是rh9是里面的mysql,进入mysql正常,但是当我想改超级用户密码:
mysqladmin -u root -password abc
总是提示:
mysqladmin:connect to server at 'localhost' failed
eroor:"Access denied for user:'root@localhost'(Using password:YES)"

这是什么原因?zhang@ls.qdedu.net
发表于 2003-12-5 12:30:57 | 显示全部楼层

re:

debian:/home/networkboy# mysqladmin -u root -p password xxxxxx
Enter password:
debian:/home/networkboy# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 4.0.16-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> quit
Bye
发表于 2003-12-5 13:34:18 | 显示全部楼层
如果你还能以root进入mysql的话,用以下语句试试:
use mysql
update user set password=password('你要设定的root的密码') where user='root'
发表于 2003-12-5 16:37:26 | 显示全部楼层
先用mysqladmin -u root -p password xxxxxx设密码
 楼主| 发表于 2003-12-6 19:21:46 | 显示全部楼层
不行,我试了都修改不了我的密码?为什么?
发表于 2003-12-6 19:23:59 | 显示全部楼层
你原来有没有密码 如果有的话在出来让你输入密码的时候输入 没有就按回车
发表于 2003-12-6 19:25:05 | 显示全部楼层

re:

debian:/home/networkboy# mysqladmin -u root -p password xxxxxx(你要修改的密码)
Enter password:xxxxxx(输入你原来的密码)
debian:/home/networkboy# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 4.0.16-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> quit
Bye
 楼主| 发表于 2003-12-6 19:49:58 | 显示全部楼层
我的mysql的密码总是无法修改,现在我用mysql进入>提示输入use mysql;也出错提示:
Error 1044:Access ednied for user:'@localhost' to database 'mysql'
如何解决,谢谢!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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