應用程式連接MySQL 4.11版時出現的不支援認證協定錯誤
作者: Ahan 日期: 2005-03-11 22:35
前幾天試著用IIS + PHP + MySQL架Blog時,在Blog安裝的時候突然給我出現了 Client does not support authentication protocol
這個錯誤訊息,查了孤狗後知道原來MySQL 4.11使用了新的雜湊密碼演算法,所以舊有的Client是無法通過密碼認證的,MySQL官方網站提供的解決方式如下。
<ol>
<li>升級所有使用4.11或更新的函式庫的客戶端程式。</li>
<li> 若仍然使用舊有連線程式時,必須使用舊有4.1.0以前版本的密碼雜湊系統。 <br>
<p>Tell the server to use the older password hashing algorithm: <br>
Start mysqld with the --old-passwords option. <br>
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: </p>
<p><font color="#0000FF">mysql> SELECT Host, User, Password FROM mysql.user<br>
-> WHERE LENGTH(Password) > 16;</font></p>
</li>
<li>使用 SET PASSWORD 以及 OLD_PASSWORD() 命令重設新版4.11的的密碼系統至舊版本,範例如下: <br>
<p>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. </p>
<p><font color="#0000FF">mysql> SET PASSWORD FOR<br>
-> 'some_user'@'some_host' = OLD_PASSWORD('newpwd');</font></p>
<p>Alternatively, use UPDATE and FLUSH PRIVILEGES: </p>
<p><font color="#0000FF">mysql> UPDATE mysql.user SET Password = OLD_PASSWORD('newpwd')<br>
-> WHERE Host = 'some_host' AND User = 'some_user';<br>
mysql> FLUSH PRIVILEGES;</font></p>
</li>
</ol>
這個錯誤訊息,查了孤狗後知道原來MySQL 4.11使用了新的雜湊密碼演算法,所以舊有的Client是無法通過密碼認證的,MySQL官方網站提供的解決方式如下。
<ol>
<li>升級所有使用4.11或更新的函式庫的客戶端程式。</li>
<li> 若仍然使用舊有連線程式時,必須使用舊有4.1.0以前版本的密碼雜湊系統。 <br>
<p>Tell the server to use the older password hashing algorithm: <br>
Start mysqld with the --old-passwords option. <br>
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: </p>
<p><font color="#0000FF">mysql> SELECT Host, User, Password FROM mysql.user<br>
-> WHERE LENGTH(Password) > 16;</font></p>
</li>
<li>使用 SET PASSWORD 以及 OLD_PASSWORD() 命令重設新版4.11的的密碼系統至舊版本,範例如下: <br>
<p>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. </p>
<p><font color="#0000FF">mysql> SET PASSWORD FOR<br>
-> 'some_user'@'some_host' = OLD_PASSWORD('newpwd');</font></p>
<p>Alternatively, use UPDATE and FLUSH PRIVILEGES: </p>
<p><font color="#0000FF">mysql> UPDATE mysql.user SET Password = OLD_PASSWORD('newpwd')<br>
-> WHERE Host = 'some_host' AND User = 'some_user';<br>
mysql> FLUSH PRIVILEGES;</font></p>
</li>
</ol>
發表評論
訂閱
上一篇
返回
下一篇
