[英]Jython Connecting to Mysql Database Error
I have been solving a problem with MYSQL and Jython for the past two days. 在过去的两天内,我一直在解决MYSQL和Jython的问题。
I keep receiving the error: 我不断收到错误:
zxJDBC.DatabaseError: Communication failure during handshake.
zxJDBC.DatabaseError:握手期间通信失败。 Is there a server running on localhost:3306?
是否在localhost:3306上运行服务器? [SQLCode: 0]
[SQLCode:0]
I have tried out multiple solutions: 我已经尝试了多种解决方案:
1.) Changing the port number of mysql
1.)更改mysql的端口号
2.) Tried out variations of connection methods
2.)尝试各种连接方法
However, none have worked so far. 但是,到目前为止,还没有任何工作。
My netstat shows that there is indeed a server running on port 3306 : 我的netstat显示确实在端口3306上运行着一台服务器:
0.0.0.0 3306 c:\\xampp\\mysql\\bin\\mysqld.exe
0.0.0.0 3306 c:\\ xampp \\ mysql \\ bin \\ mysqld.exe
My code goes as: 我的代码如下:
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)
If you can, please help! 如果可以的话,请帮忙! Many thanks!
非常感谢!
You might wanna go through this thread. 您可能想通过此线程。
MySQL Forum MySQL论坛
It is a similar error 这是一个类似的错误
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.