问题描述:
连接Mysql时,当密码正确时提示1251错误:
#1251 - Client does not support authentication protocol requested by server; consider upgrading MySQL client
密码不正确时,则提示:
#1045 - Access denied for user \'root\'@\'localhost\' (using password: NO)
原因:
由于MySQL 4.1 及其后版本验证协议使用的密码哈希算法与老的客户端不兼容,在PHPMYADMIN里用正确密码登陆也会提示:#1251错误.
解决方法:打开mysql客户端,输入以下两种方法之一即可
第一种:SET PASSWORD FOR \'dbuser\'@\"localhost\"=OLD_PASSWORD(\'yourPassword\');
第 二种:mysql> UPDATE mysql.user SET Password = OLD_PASSWORD(\'newpwd\')-> WHERE Host = \'some_host\' AND User = \'some_user\';mysql> FLUSH PRIVILEGES;
呵呵,也许对你有用。