將MySQL升級成4.1版遇到 ‘Warning: mysql_connect() [function.mysql-connect]: Client does not support authentication protocol requested by server; consider upgrading MySQL client in …..’ 錯誤訊息要如何解?

[服務架設][系統]將MySQL升級成4.1版遇到 ‘Warning: mysql_connect() [function.mysql-connect]: Client does not support authentication protocol requested by server; consider upgrading MySQL client in …..’ 錯誤訊息要如何解?

錯誤發生的原因是 4.1 版以後的密碼採用新的密碼驗證機制,如果用 myPhpAdmin 去新增出來的使用者,會採用新的機制給予密碼,舊的 mysql client 連進來要驗證密碼時就會出現上述錯誤。

解法:

將該要給舊 mysql client 用的帳號改成舊有的密碼機制,例如用新的 mysql 做以下動作:

$ mysql -h new_server_host -u root -p
mysql> SET PASSWORD FOR ‘some_user‘@’some_host‘ = OLD_PASSWORD(‘new_password‘);
mysql> FLUSH PRIVILEGES;

紅色標示的部分依照自身情況給值。

詳情請看這裡

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.