"Www.ncu.edu.tw 之PHP4版本的 mysql client 3.23.58 無法支援 MySQL 4.1 以上版本資料庫連接?" 修訂間的差異

出自 NCUCCWiki
前往: 導覽搜尋
行 1: 行 1:
* 問題描述:以www.ncu.edu.tw 之PHP4版本的 mysql client 3.23.58 無法支援 MySQL 4.1 以上版本資料庫
+
* 問題描述:以www.ncu.edu.tw 之PHP4版本的 mysql client 3.23.58 無法連線 MySQL 4.1 以上版本資料庫
  
 
* 錯誤訊息: Client does not support authentication protocol requested by server; consider upgrading MySQL client  
 
* 錯誤訊息: Client does not support authentication protocol requested by server; consider upgrading MySQL client  

於 2008年6月4日 (三) 02:57 的修訂

  • 問題描述:以www.ncu.edu.tw 之PHP4版本的 mysql client 3.23.58 無法連線 MySQL 4.1 以上版本資料庫
  • 錯誤訊息: Client does not support authentication protocol requested by server; consider upgrading MySQL client
  • 原因:因為 MySQL 4.1 以上版本為了提高安全性,使用了新的密碼驗證機制。如此,MySQL 的 Client Library 需要 4.0 版本以上。但目前在 Client 端所使用的 PHP 版本若為 5.0 以下(如 4.3.9),其內建的 MySQL Library 大都為 3.23,並不支援新版的密碼驗證機制。
  • 解決方案(以下擇其一):
  1. 將 PHP 升級為 5.0版以上
  2. 切換 PHP 4 的 MySQL extension 為 MySqlLi
  3. 在 MySQL console 下,更新密碼形式改為 OLD_PASSWORD() (設回原來舊版的密碼驗證機制)。

mysql> UPDATE mysql.user SET Password = OLD_PASSWORD('newpwd')

   -> WHERE Host = 'some_host' AND User = 'some_user';

mysql> FLUSH PRIVILEGES;