关于正确配置phpmyadin,解决Client does not support authentication protocol的问题

 

最近在sourceforge下载了个最新的phpMyAdmin-2.6.4-pl3来配我的MYSQL 5.0

不想先是MYSQL出现问题,不能正确自启动,经过多放努力,终于搞定,没想到phpmyadmin也出现了问题,默认root用户(没密码)还能正确登陆,但是通过phpmyadinmysql密码修改,却不能用phpmyadin登陆(dos状态下可以登陆),一开始还以为是phpmyadin配置的问题,修改了半天也没成功,老是出错,当然更不能登陆……

     最后从网上搜索了一番终于发现是编码出现了问题,原文如下:

好多朋友升级了mysql4.10以上会发生此错误(Client does not support authentication protocol,php4.xphpmyadmin之类的程序连接不上数据库,是因为mysql4.10以上改变了用户密码验证协议,php的连接模块也需要更换新的,php5默认就是这种新的连接模块...

不想更换可以这样:
CODE  
# SET PASSWORD FOR 'some_user'@'some_host' = OLD_PASSWORD('newpwd');
# FLUSH PRIVILEGES;

官方说明文档:
CODE  
Client does not support authentication protocol
MySQL 4.1 and up uses an authentication protocol based on a password hashing algorithm that is incompatible with that used by older clients. If you upgrade the server to 4.1, attempts to connect to it with an older client may fail with the following message:

shell> mysql
Client does not support authentication protocol requested
by server; consider upgrading MySQL client

To solve this problem, you should use one of the following approaches:

Upgrade all client programs to use a 4.1.1 or newer client library.

When connecting to the server with a pre-4.1 client program, use an account that still has a pre-4.1-style password.

Reset the password to pre-4.1 style for each user that needs to use a pre-4.1 client program. This can be done using the SET PASSWORD statement and the OLD_PASSWORD() function:

mysql> SET PASSWORD FOR
   -> 'some_user'@'some_host' = OLD_PASSWORD('newpwd');

Alternatively, use UPDATE and FLUSH PRIVILEGES:

mysql> UPDATE mysql.user SET Password = OLD_PASSWORD('newpwd')
   -> WHERE Host = 'some_host' AND User = 'some_user';
mysql> FLUSH PRIVILEGES;

Substitute the password you want to use for ``newpwd'' in the preceding examples. MySQL cannot tell you what the original password was, so you'll need to pick a new one.

Tell the server to use the older password hashing algorithm:

Start mysqld with the --old-passwords option.

Assign an old-format password to each account that has had its password updated to the longer 4.1 format. You can identify these accounts with the following query:

mysql> SELECT Host, User, Password FROM mysql.user
   -> WHERE LENGTH(Password) > 16;

For each account record displayed by the query, use the Host and User values and assign a password using the OLD_PASSWORD() function and either SET PASSWORD or UPDATE, as described earlier.

 

    其实在配置phpmyadmin中我还出现了登陆框不能正常显示中文的状况(英文可以正常显示),最后通过把$cfg['Lang']前面的分号去掉,将之修改为$cfg['Lang']     = 'zh',将语言强制转换为中文就解决了中文显示乱码的问题。

其他配置我就不再一一赘述了,这些都是我在配置中遇到的问题,以及解决的办法,写在这里以共大家参考………

 

                                                                        阿木戈多 2005-11-2

posted @ 2005-11-03 21:55  阿木戈多  阅读(1059)  评论(0编辑  收藏  举报