其一: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; 可以解决这个问题

解决方案 »

  1.   

    我试了没反映呀!
    C:\Program Files\MySQL\MySQL Server 4.1\bin>mysql -p -u root
    Enter password: ******
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 2 to server version: 4.1.14-ntType 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql> set pasword for ->'some_user'@'some_host'=old_password('newpwd')
        -> flush privileges
        -> :
        -> ;
    ERROR 1193 (HY000): Unknown system variable 'pasword'
    mysql>  set pasword for ->'some_user'@'some_host'=old_password('newpwd');
    ERROR 1193 (HY000): Unknown system variable 'pasword'
    mysql>  set password for ->'some_user'@'some_host'=old_password('newpwd');
    ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
    corresponds to your MySQL server version for the right syntax to use near '->'so
    me_user'@'some_host'=old_password('newpwd')' at line 1
    mysql>  set password for ->'some_user'@'some_host'=old_password('newpwd')
        ->  set password for ->'some_user'@'some_host'=old_password('newpwd');
    ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
    corresponds to your MySQL server version for the right syntax to use near '->'so
    me_user'@'some_host'=old_password('newpwd')
     set password for ->'some_user'' at line 1
    mysql>  set password for -> 'root'@'localhost'=old_password('newpwd');
    ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
    corresponds to your MySQL server version for the right syntax to use near '-> 'r
    oot'@'localhost'=old_password('newpwd')' at line 1
    mysql>
      

  2.   

    我试了结果如下:
    mysql>  UPDATE mysql.user SET Password = OLD_PASSWORD('newpwd')
        ->  WHERE Host = 'some_host' AND User = 'some_user';
    Query OK, 0 rows affected (0.00 sec)
    Rows matched: 0  Changed: 0  Warnings: 0mysql>  FLUSH PRIVILEGES;
    Query OK, 0 rows affected (0.09 sec)
    但连接时出现以下错误:
    错误: 不能连接MySQL服务器: "localhost" : '' MySQL系统报告:Client does not support authentication protocol requested by server; consider upgrading MySQL client 
      

  3.   

    我又试了一下:
    mysql>  UPDATE mysql.user SET Password = OLD_PASSWORD('newpwd')
        ->  WHERE Host = 'localhost' AND User = 'root';
    Query OK, 1 row affected (0.00 sec)
    Rows matched: 1  Changed: 1  Warnings: 0mysql>  FLUSH PRIVILEGES;
    Query OK, 0 rows affected (0.02 sec)实际是这样的
    错误: 不能连接MySQL服务器: "localhost" : '' MySQL系统报告:Access denied for user 'root'@'localhost' (using password: YES)