2010-11-30 216 views

回答

7

solution是使用MySQL的OLD_PASSWORD函数更新数据库用户的密码。例如:

[[email protected] ~]$ mysql -u root -p mysql 

Enter password: 
Reading table information for completion of table and column names 
You can turn off this feature to get a quicker startup with -A 

Welcome to the MySQL monitor. Commands end with ; or \g. 
Your MySQL connection id is 267 
Server version: 5.1.41-3ubuntu12.1 (Ubuntu) 

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. 

mysql> use mysql; 
Database changed 

mysql> update user set Password=OLD_PASSWORD('password') WHERE User='username'; 

Query OK, 0 rows affected (0.02 sec) 
Rows matched: 0 Changed: 0 Warnings: 0 

mysql> flush privileges; 

Query OK, 0 rows affected (0.00 sec) 

mysql> 
+0

从PHP 5.6.5开始,您需要在`my.ini`的`[mysqld]`部分设置这些值,以启用与mysql 4客户端的连接: old_passwords = 1 secure-auth = 0 您可能还需要将`mysql_old_password`添加到`mysql` db中`user`表中的`plugin`部分 – Wertisdk 2013-11-06 10:52:50

2

这是一个已知的MySQL问题。 C.5.2.4. Client does not support authentication protocol:

MySQL 5.1使用基于密码散列算法的身份验证协议,该算法与旧版(4.1之前)客户端使用的算法不兼容。如果从4.0升级服务器,尝试使用旧客户端连接到服务器可能会失败,并显示以下消息:“客户端不支持服务器请求的验证协议 ;请考虑升级MySQL客户端”。

要解决此问题,您应该使用以下方法之一:
1.升级所有客户端程序以使用4.1.1或更新的客户端库。
2.使用4.1之前的客户端程序连接到服务器时,请使用仍具有4.1以前版本密码的帐户。
3.为每个需要使用4.1之前的客户端程序的用户重置密码为4.1之前的样式。
4.通知服务器使用旧密码散列算法。

+0

这是解决办法,但我发现直接程序来解决它(这是在更具体的细节相同的答案),我现在就把它在这里,无论如何,THX! – palmic 2010-12-01 10:39:27

相关问题