mysql设置密码登陆时出现的问题:client does not support authentication protocol requested by server,consider upgrading mysql clie
linux 下配置mysql,版本是4.1.18,安装启动以后我给root用户设置密码
#/usr/local/mysql/bin/mysqladmin -u root password 123456
注:mysql安装在/usr/local/mysql目录下
登陆时键入#mysql -u root -p
系统提示entering password: 键入123456,即刚才设置的密码
但是这时系统给出错误提示error 1251:client does not support authentication protocol requested by server:consider upgrading mysql client
上网查了一下官方的说法是
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是client和server一起装上了的)
请使用以下两种方法之一
其一:
mysql> SET PASSWORD FOR
-> 'some_user'@'some_host' = OLD_PASSWORD('newpwd');
其二:
mysql> UPDATE mysql.user SET Password=OLD_PASSWORD('newpwd')
-> WHERE Host = 'some_host' AND User = 'some_user';
mysql> FLUSH PRIVILEGES;
我试了一下但不知道为什么系统提示我syntax error near unexpected token '('
我的句法是这样的 SET PASSWORD FOR root@localhost=OLD_PASSWORD('123456');
有什么不对吗?另外我不懂那个mysql>是什么意思啊?是在mysql的安装目录下敲上边这些命令吗?就是说我得先cd /usr/local/mysql再set password??
请达人相助,如果真的不行的话我只有重新下个新版本的来安装了。。。。