2013-02-21 224 views
0

過去兩天我一直在用MYSQL和Jython解決問題。Jython連接到Mysql數據庫錯誤

我不斷收到錯誤:

zxJDBC.DatabaseError: Communication failure during handshake. Is there a server running on localhost:3306? [SQLCode: 0]

我已經嘗試了多種解決方案:

1.) Changing the port number of mysql

2.) Tried out variations of connection methods

然而,沒有到目前爲止的工作。

我netstat顯示的確實是有在端口3306上運行的服務器:

0.0.0.0 3306 c:\xampp\mysql\bin\mysqld.exe

我的代碼去爲:

from com.ziclix.python.sql import zxJDBC 
userInfo = {'user':'root', 'password':'', 'databaseName':'amda','serverName':'localhost','port':3306} 
dbconnection = zxJDBC.connectx("org.gjt.mm.mysql.MysqlDataSource", **userInfo) 

如果可以的話,請大家幫忙!非常感謝!

+0

您的JDBC連接驅動程序不是最新的,請去http://dev.mysql.com/downloads/下載最新的驅動程序。 – 2013-03-29 02:31:20

回答

0

你可能想要通過這個線程。
MySQL Forum
這是一個類似的錯誤