如何在MySQL 5.0中管理用户 [英] How to admin user in MySQL 5.0

查看:57
本文介绍了如何在MySQL 5.0中管理用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我刚刚在我的太阳箱上安装了MySQL 5.0(运行Solaris 10,从blastwave安装

)。这是我第一次使用MySQL,所以我没有任何

exp。


我有一些麻烦:

- 我通过以下命令为root帐户设置密码:


#mysql -h atlantis -u root mysql

mysql>更新用户设置密码= PASSWORD('''123456'')其中user =''root'';

mysql>退出


但是,我可以使用root帐户再次登录而无需通过检查????


- 接下来,我创建新的用户名admin

#mysql -h atlantis -u root

mysql>创建由''admin''标识的用户admin;

mysql> create database newdb;

mysql>全部在newdb上。*''admin''由''admin''识别;


再次,我不能使用管理员帐户登录到newdb数据库?


请帮我研究一下。


提前致谢。

Hi all,

I''ve just installed MySQL 5.0 on my sun box (runing Solaris 10, install
from blastwave). This is my first time with MySQL so I don''t have any
exp with it.

I have some troubles as:
- I set password for root account via this command:

# mysql -h atlantis -u root mysql
mysql> update user set password=PASSWORD(''123456'') where user = ''root'';
mysql> exit

However, I can login again with root account without pass check ????

- Next, I create new user name admin
# mysql -h atlantis -u root
mysql> create user admin identified by ''admin'' ;
mysql> create database newdb ;
mysql> GRAND ALL ON newdb.* TO ''admin'' IDENTIFIED BY ''admin'' ;

Once again, i can''t use admin account to login to newdb database??

Please help me to study them.

Thanks in advance.

推荐答案


#mysql -h atlantis -u root mysql
mysql>更新用户设置密码= PASSWORD('''123456'')其中user =''root'';
mysql>退出


你需要刷新权限才能让MySQL读取授权表到

内存。

mysql>全部在newdb上。*''admin''由''admin''识别;



你不是说GRANT吗?

mysql>创建由''admin''标识的用户admin;
mysql> create database newdb;
mysql>全部在newdb上。*''admin''由''admin''识别;
# mysql -h atlantis -u root mysql
mysql> update user set password=PASSWORD(''123456'') where user = ''root'';
mysql> exit
you need to flush the privileges to make MySQL read the grant tables into
memory.
mysql> GRAND ALL ON newdb.* TO ''admin'' IDENTIFIED BY ''admin'' ;

Don''t you mean GRANT?
mysql> create user admin identified by ''admin'' ;
mysql> create database newdb ;
mysql> GRAND ALL ON newdb.* TO ''admin'' IDENTIFIED BY ''admin'' ;




您还应该指定用户所属的主机。例如,如果

用户admin应该能够从localhost登录,请将用户指定为

admin @ localhost(或所有主机的admin @''%'' ,admin @''192.168.0.%''适用于所有

主机,网络范围为192.168.0.x aso)。所以你可以写一下


创建用户admin @ localhost''admin''标识;

创建数据库newdb;

grant全部在newdb。*到admin @ localhost; (这里你不再需要''确定

了',因为你已经在CREATE USER命令中指定了它。


你还应该请注意没有匿名用户(没有

名称的用户,因此请查看mysql.user表)。


在此处查找详细信息:

http ://dev.mysql.com/doc/refman/5.0/...ge-system.html
http://dev.mysql.com/doc/refman/5.0/...anagement.html


Markus



You should also specify the host to which the user belongs. For example, if
user admin should be able to log in from localhost, specify the user as
admin@localhost (or admin@''%'' for all hosts, admin@''192.168.0.%'' for all
hosts within the network range 192.168.0.x a.s.o.). So you could write

create user admin@localhost identified by ''admin'';
create database newdb;
grant all on newdb.* to admin@localhost; (here you don''t need ''identified
by'' anymore, because you already specified it in the CREATE USER command)

You should also take care that there are no anonymous users (users without a
name, therefore take a look into the mysql.user table).

Find detailed information here:

http://dev.mysql.com/doc/refman/5.0/...ge-system.html
http://dev.mysql.com/doc/refman/5.0/...anagement.html

Markus


我的上帝,我冲了特权后,我无法登录mysql

再次,我收到此错误消息,虽然我的密码肯定是正确的。


ERROR 1251:客户端不支持请求的身份验证协议
服务器
;考虑升级MySQL客户端


????

Oh my god, after i flushed the privileges, I can''t login into mysql
again, I get this error message although my password is correct surely.

ERROR 1251: Client does not support authentication protocol requested
by server; consider upgrading MySQL client

????


AnhTai写道:
哦,天哪,在刷新权限之后,我再也无法登录到mysql
,虽然我的密码肯定是正确的但我收到此错误消息。

ERROR 1251:客户端没有支持服务器请求的身份验证协议;考虑升级MySQL客户端
Oh my god, after i flushed the privileges, I can''t login into mysql
again, I get this error message although my password is correct surely.

ERROR 1251: Client does not support authentication protocol requested
by server; consider upgrading MySQL client



http://dev.mysql.com/doc/refman/5.0/...-problems.html
< a rel =nofollowhref =http://dev.mysql.com/doc/refman/5.0/en/old-client.html\"target =_ blank> http://dev.mysql.com/doc /refman/5.0/en/old-client.html


PHP不支持MySQL的增强密码加密格式

4.1及更高版本(令人惊讶但真实!)。您可以使用--old-passwords选项运行MySQL服务器

,MySQL将使用PHP使用的4.0兼容的

密码加密。如果你这样做,我希望你

可能需要再次重置密码,以便用旧格式加密




问候,

Bill K.



Read these pages:
http://dev.mysql.com/doc/refman/5.0/...-problems.html
http://dev.mysql.com/doc/refman/5.0/en/old-client.html

PHP does not support the enhanced password encryption format of MySQL
4.1 and later (astonishing but true!). You can run the MySQL server
with the --old-passwords option, and MySQL will use the 4.0-compatible
password encryption that PHP uses. If you do that, I expect you
probably will have to reset passwords again, for them to be encrypted in
the old format.

Regards,
Bill K.


这篇关于如何在MySQL 5.0中管理用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆