ERROR 1251: Client does not support authentication protocol requested by server; consider upgrading MySQL client
今天在迁移一台数据库, 但是客户端程序在原来的机器上保持不变。 数据迁移完毕, 在新的DB做了相应的授权之后, 在客户端做了下连接测试:
mysql -uxxx -pyyy -h172.28.28.28
ERROR 1251: Client does not support authentication protocol requested by server; consider upgrading MySQL client
从字面上看好像是“验证协议不被服务端支持, 建议更新客户端”, google了一下, 得到解决方案:
在DB服务端执行:
# set password for xxx);
# flush privileges;
或者直接更新权限表:
# UPDATE mysql.user SET Password = OLD_PASSWORD('newpwd') WHERE Host = 'some_host' AND User = 'some_user';
# FLUSH PRIVILEGES;
然后再从客户端连接, 就OK了。 原因: 是因为新使用的mysql服务器版本中使用了新的密码验证机制,MySQL 4.1 and up uses an authentication protocol based on a password hashing algorithm that is incompatible with that used by older clients.
阅读(1685) | 评论(0) | 转发(0) |