應用程式連接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>
好用的.Net資源檔編輯工具
作者:Ahan 日期:2005-03-09 23:57
將 tomcat 整合到 apache
作者:Ahan 日期:2005-03-09 22:14
下載mod_jk2
下載位置:http://ftp.cis.nctu.edu.tw/data/apache/jakarta/tomcat-connectors/jk2/source/
http://ftp.cis.nctu.edu.tw/data/apache/jakarta/tomcat-connectors/jk2/source/jakarta-tomcat-connectors-jk2-2.0.2-src.tar.gz
編譯Jakarta-Tomcat-connectors 2
[root@localhost tmp]# tar -zxvf /home/bruce/linux/jakarta-tomcat-connectors-jk2-2.0.2-src.tar.gz
[root@localhost tmp]# cd jakarta-tomcat-connectors-jk2-2.0.2-src/jk/native2/
[root@localhost native2]# chmod a+x buildconf.sh
[root@localhost native2]# ./buildconf.sh
[root@localhost native2]# ./configure --with-apxs2=/usr/local/apache2/bin/apxs
[root@localhost native2]# make
[root@localhost native2]# cp /tmp/jakarta-tomcat-connectors-jk2-2.0.2-src/jk/build/jk2/apache2/.libs/mod_jk2.so /usr/local/apache2/modules/mod_jk2.so
[root@localhost native2]# cp /tmp/jakarta-tomcat-connectors-jk2-2.0.2-src/jk/conf/workers2.properties /usr/local/apache2/conf/workers2.properties
編輯 httpd.conf
尋找DSO
加入LoadModule jk2_module modules/mod_jk2.so
編輯 workers2.properties
修改最下面的example及servlets
[uri:/jsp-examples/*]
info=JSP examples, map requests for all JSP pages to Tomcat.
context=/jsp-examples
[uri:/servlets-examples/*]
info=Servlet examples, map requests for all servlets to Tomcat.
context=/servlets-examples
重新啟動tomcat及apache即完成整合
下載位置:http://ftp.cis.nctu.edu.tw/data/apache/jakarta/tomcat-connectors/jk2/source/
http://ftp.cis.nctu.edu.tw/data/apache/jakarta/tomcat-connectors/jk2/source/jakarta-tomcat-connectors-jk2-2.0.2-src.tar.gz
編譯Jakarta-Tomcat-connectors 2
[root@localhost tmp]# tar -zxvf /home/bruce/linux/jakarta-tomcat-connectors-jk2-2.0.2-src.tar.gz
[root@localhost tmp]# cd jakarta-tomcat-connectors-jk2-2.0.2-src/jk/native2/
[root@localhost native2]# chmod a+x buildconf.sh
[root@localhost native2]# ./buildconf.sh
[root@localhost native2]# ./configure --with-apxs2=/usr/local/apache2/bin/apxs
[root@localhost native2]# make
[root@localhost native2]# cp /tmp/jakarta-tomcat-connectors-jk2-2.0.2-src/jk/build/jk2/apache2/.libs/mod_jk2.so /usr/local/apache2/modules/mod_jk2.so
[root@localhost native2]# cp /tmp/jakarta-tomcat-connectors-jk2-2.0.2-src/jk/conf/workers2.properties /usr/local/apache2/conf/workers2.properties
編輯 httpd.conf
尋找DSO
加入LoadModule jk2_module modules/mod_jk2.so
編輯 workers2.properties
修改最下面的example及servlets
[uri:/jsp-examples/*]
info=JSP examples, map requests for all JSP pages to Tomcat.
context=/jsp-examples
[uri:/servlets-examples/*]
info=Servlet examples, map requests for all servlets to Tomcat.
context=/servlets-examples
重新啟動tomcat及apache即完成整合


