mysql>set password for 'root'@'localhost' = old_password('newpassword');

解决方案 »

  1.   

    ===> Client does not support authentication protocol
    好多朋友升级了mysql为4.10以上会发生此错误,php4.x下phpmyadmin之类的程序连接不上数据库,是因为mysql4.10以上改变了用户密码验证协议,php的连接模块也需要更换新的,php5默认就是这种新的连接模块...不想更换可以这样:
    CODE  
    # SET PASSWORD FOR 'some_user'@'some_host' = OLD_PASSWORD('newpwd'); 
    # FLUSH PRIVILEGES;
     
    官方说明文档:
    CODE  
    Client does not support authentication protocol 
    MySQL 4.1 and up uses an authentication protocol based on a password hashing algorithm that is incompatible with that used by older clients. If you upgrade the server to 4.1, attempts to connect to it with an older client may fail with the following message: shell> mysql 
    Client does not support authentication protocol requested 
    by server; consider upgrading MySQL client To solve this problem, you should use one of the following approaches: Upgrade all client programs to use a 4.1.1 or newer client library. When connecting to the server with a pre-4.1 client program, use an account that still has a pre-4.1-style password. Reset the password to pre-4.1 style for each user that needs to use a pre-4.1 client program. This can be done using the SET PASSWORD statement and the OLD_PASSWORD() function: mysql> SET PASSWORD FOR 
       -> 'some_user'@'some_host' = OLD_PASSWORD('newpwd'); Alternatively, use UPDATE and FLUSH PRIVILEGES: mysql> UPDATE mysql.user SET Password = OLD_PASSWORD('newpwd') 
       -> WHERE Host = 'some_host' AND User = 'some_user'; 
    mysql> FLUSH PRIVILEGES; Substitute the password you want to use for ``newpwd'' in the preceding examples. MySQL cannot tell you what the original password was, so you'll need to pick a new one. Tell the server to use the older password hashing algorithm: Start mysqld with the --old-passwords option. Assign an old-format password to each account that has had its password updated to the longer 4.1 format. You can identify these accounts with the following query: mysql> SELECT Host, User, Password FROM mysql.user 
       -> WHERE LENGTH(Password) > 16; For each account record displayed by the query, use the Host and User values and assign a password using the OLD_PASSWORD() function and either SET PASSWORD or UPDATE, as described earlier.  
      

  2.   

    一个版本的bug,重新设一个数据库的密码应该就可以了
      

  3.   

    我的PHP 5.0.3 + Mysql 4.1.10a就不存在这个问题,用的还是常规Mysql连接方法<?php
    $conn = mysql_connect("localhost","root","");
    mysql_select_db("test",$conn);
    ...?>
      

  4.   

    使用 fzjw(Icy mote)大哥的建议就能够解决问题!因为我也碰到过!