Jython连接到Mysql数据库错误
问题描述:
过去两天我一直在用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)
如果可以的话,请大家帮忙!非常感谢!
您的JDBC连接驱动程序不是最新的,请去http://dev.mysql.com/downloads/下载最新的驱动程序。 – 2013-03-29 02:31:20