| 導購 | 订阅 | 在线投稿
分享
 
 
 

JDBC 連接MySQL 問題

來源:互聯網  2008-06-24 08:57:05  評論

今天用mm.mysql-2.0.4-bin.jar連接mysql,報錯如下:

Communication failure during handshake. Is there a server running on localhost:3306?

我的Mysql數據庫的版本:5.0.18。使用mm.mysql-2.0.4-bin.jar,。出現了上面的問題。mysql服務是開的,有可能是驅動不行了,上mysql下載了個對應5.0的版本:mysql-connector-java-5.0.8-bin.jar ,再連接,ok,沒有出錯。

drivers=org.gjt.mm.mysql.Driver poolapp.url=jdbc:mysql://localhost/test?user=root&password=ffcsoss&useUnicode=true&characterEncoding=8859_1

ysql網站上的說明:

MySQL Connector/J is a JDBC Type 4 driver. Different versions are available that are compatible with the JDBC-3.0 and JDBC-4.0 specifications. The Type 4 designation means that the driver is pure-Java implementation of the MySQL protocol and does not rely on the MySQL client libraries.

今天用mm.mysql-2.0.4-bin.jar連接mysql,報錯如下: Communication failure during handshake. Is there a server running on localhost:3306? 我的Mysql數據庫的版本:5.0.18。使用mm.mysql-2.0.4-bin.jar,。出現了上面的問題。mysql服務是開的,有可能是驅動不行了,上mysql下載了個對應5.0的版本:mysql-connector-java-5.0.8-bin.jar ,再連接,ok,沒有出錯。 drivers=org.gjt.mm.mysql.Driver poolapp.url=jdbc:mysql://localhost/test?user=root&password=ffcsoss&useUnicode=true&characterEncoding=8859_1 ysql網站上的說明: MySQL Connector/J is a JDBC Type 4 driver. Different versions are available that are compatible with the JDBC-3.0 and JDBC-4.0 specifications. The Type 4 designation means that the driver is pure-Java implementation of the MySQL protocol and does not rely on the MySQL client libraries.
󰈣󰈤
 
 
 
>>返回首頁<<
 
 
 
 
 熱帖排行
 
王朝網路微信公眾號
微信掃碼關註本站公眾號 wangchaonetcn
 
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有