威卡& MySQL 设置连接
WEKA Explorer 无法打开与 MySQL 的连接。
连接到:jdbc:mysql://MYSERVER:3306/NAME = true
顺便说一句:mysql驱动程序已下载 mysql-connector-java-5.1.14-bin & 类路径已设置。
(用户和密码都可以,因为它与 MySQL Workbench 一起使用)
当单击 JButton OK(以“打开 DB”形式)时,消息框会显示错误 - 请参阅图片:
(屏幕截图显示臭名昭著的“无驱动程序”错误)
weka 版本是 3.6.3。
有什么建议吗?
WEKA Explorer can't open a connection to MySQL.
connecting to: jdbc:mysql://MYSERVER:3306/NAME = true
by the way: mysql driver was downloaded
mysql-connector-java-5.1.14-bin &
classpath was set.
(User & Pass are ok because it works with MySQL Workbench)
when clicking on the JButton OK (in the form 'Open DB'), then a message box shows an error
- see image:
(screen shot shows infamous "no driver" error)
weka version is 3.6.3.
any suggestions ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
在同样的问题上浪费了半个小时,答案如下:
从 http://dev 下载连接器.mysql.com/downloads/connector/j/
提取 JAR 文件。
编辑 C:\Program Files\Weka-3-6\RunWeka.ini
将最后一行更改为:
您当然可以将 mysql-connector jar 保存到不同的路径,但请注意 forward斜杠,不用介意在 Windows 上。
Wasted half an hour on this same problem, here's the answer:
Download the connector from http://dev.mysql.com/downloads/connector/j/
Extract the JAR file.
Edit
C:\Program Files\Weka-3-6\RunWeka.ini
Change last line to:
You may of course save your mysql-connector jar to a different path, but mind the forward slash, nevermind being on Windows.
我解决了这个问题一整天。解决方案花了我几个小时。 如果您使用的是基于 ubuntu 或 debian 的 Linux,请首先安装
mysql-connector-java
:它将在
/ 中安装 mysql-connector-java-* 链接usr/share/java/mysql-connector-java.jar
我用上面的脚本替换了
/usr/bin/weka
。也许可以为像我这样的人节省时间。另一个选择是编辑桌面菜单:java -cp "/usr/share/java/mysql.jar:/usr/share/java/weka.jar" -Xmx500m weka.gui.GUIChooser
(在我的例子中 mysql.jar 链接驱动程序的正确版本)
I solved this problem along the day. The solution took me hours. If you are in ubuntu or debian-based linux, first install
mysql-connector-java
with:It will install mysql-connector-java-* links in
/usr/share/java/mysql-connector-java.jar
I replaced
/usr/bin/weka
with the script above. Maybe could save hours for people like me. Another option is edit your desktop menu with:java -cp "/usr/share/java/mysql.jar:/usr/share/java/weka.jar" -Xmx500m weka.gui.GUIChooser
(in my case mysql.jar links the correct version of the driver)
完成 CLASSPATH 变量后,您可能需要创建一个“DatabaseUtlils.props”文件并在其中添加以下行,
jdbcDriver=com.mysql.jdbc.Driver
并将其导入到 Weka 下“切换数据库设置”
干杯!
After you're done with CLASSPATH variable, You might need to create a "DatabaseUtlils.props" file and add following line in it,
jdbcDriver=com.mysql.jdbc.Driver
and import it in Weka under "switch database setup"
Cheers!
实际上,可以提取源jar并导入到eclipse maven中,并在pom.xml中添加Mysql依赖项,然后使用参数“clean install”运行maven build,一旦完成,您将遇到很多错误,您可以忽略它们JUnit 测试然后将项目作为 Java 应用程序运行,并使用 GUI 类“weka.gui.GUIChooser”添加连接字符串并顺利进行。
Actually and can extract the source jar and import into eclipse maven and add the Mysql dependency in the pom.xml , than run maven build with parameters "clean install" , once it is finished you will have alot of errors you can ignore them those are JUnit testing and than run project as a Java Application and use the GUI class "weka.gui.GUIChooser" add the connection string and smooth sailing.