以下的文章主要介紹的是CFMX連接MySQL4.1時經常出現錯誤的實際解決方法, 今天把MySQL數據庫升級到4.1之後,其程序連接的數據庫出現了錯誤,於是就打開admin校驗數據源,果然不能連接,出錯信息如下:
- Connection verification failed for data source:
mysql_bad java.sql.SQLException:
Communication failure during handshake.Is there a server running on localhost:3306?- The root cause was that: java.sql.SQLException:
Communication failure during handshake. Is there a server running on localhost:3306?
記得以前看過一篇blog,提到了解決辦法,於是"趕緊的"
先到mysql.com下個最新的JDBC驅動,然後將下回來的壓縮包裡的"mysql-connector-java-3.1.6-bin.jar"
放到$CFMX_HOME/runtime/servers/lib/ (for CFMX Server Configuration )或者$JRUN_HOME/servers/lib/(for CFMX on JRun Configuration),比如我機器的是:C:\blackstone\runtime\lib
然後重起CFMX.
重新定義數據源,在"Driver"下拉框這項選擇"other",接下來的配置如下圖:
提交後數據源添加成功.
之所以升級到mysql4.1後數據源出錯,是因為cfmx的jdbc驅動還是舊的.
相信MM在不久後會更新內置的JDBC驅動,不過在blackstone beta2裡的是舊的.