分享、学习、提高
2007/08/22 15:00
提示:
Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in /www/xxxx/lib.php on line 31
Connect to mysql failed:
Client does not support authentication protocol requested by server; consider upgrading MySQL client


查了一下,官方的说明:
引用

MySQL 5.0 uses an authentication protocol based on a password hashing algorithm that is incompatible with that used by older (pre-4.1) clients. If you upgrade the server from 4.0, attempts to connect to it with an older client may fail with the following message:

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


解决方法是:
引用
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;

地址:http://dev.mysql.com/doc/refman/5.0/en/old-client.html


我建数据库用户时,使用了Grant All on db.* to hx identified by 'hxpass',这样密码是新的加密方式,解决的办法就是将密码重置为旧的(用OLD_PASSWORD加密的)密码。

中文参考资料:http://www.itlearner.com/article/2007/3759.shtml
发表评论
表情
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
昵称   密码   游客无需密码
网址   电邮   [注册]