使用phpmyadmin登陆时遇到Client does not support authentication protocol requested by server; conside的解决办法

登陆时键入#mysql -u root -p
系统提示entering password: 键入123456,即刚才设置的密码
但是这时系统给出错误提示error 1251:Client does not support authentication protocol requested by server; conside
上网查了一下官方的说法是

MySQL 4.1 and up uses an authentication protocol based on a password hashing algorithm that is incompatible with that used by older clients. …..

如果你升级mysql到4.1以上版本后遇到以上问题,请先确定你的mysql client 是4.1或者更高版本.(WINDOWS下有问题你就直接跳到下面看解决方法了,因为MYSQL 在WINDOWS是clientserver一起装上了的)

请使用以下两种方法之一

其一:

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

上述红色颜色的,要针对性的修改,例如’root‘@’localhost‘ = OLD_PASSWORD(‘123456‘);

修改完成后,一般会提示:OK之类的提示!!就是成功了!!下面这种方法没有具体测试,只限提供。

其二:

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