威卡& MySQL 设置连接

发布于 2024-10-07 17:17:26 字数 426 浏览 5 评论 0原文

WEKA Explorer 无法打开与 MySQL 的连接。

连接到:jdbc:mysql://MYSERVER:3306/NAME = true

顺便说一句:mysql驱动程序已下载 mysql-connector-java-5.1.14-bin & 类路径已设置。

(用户和密码都可以,因为它与 MySQL Workbench 一起使用)

当单击 JButton OK(以“打开 DB”形式)时,消息框会显示错误 - 请参阅图片:

Error Message

(屏幕截图显示臭名昭著的“无驱动程序”错误)

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:

Error Message

(screen shot shows infamous "no driver" error)

weka version is 3.6.3.

any suggestions ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

鲜血染红嫁衣 2024-10-14 17:17:26

在同样的问题上浪费了半个小时,答案如下:

http://dev 下载连接器.mysql.com/downloads/connector/j/

提取 JAR 文件。

编辑 C:\Program Files\Weka-3-6\RunWeka.ini

将最后一行更改为:

cp=%CLASSPATH%;c:/mysql-connector-java-5.1.16-bin.jar

您当然可以将 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:

cp=%CLASSPATH%;c:/mysql-connector-java-5.1.16-bin.jar

You may of course save your mysql-connector jar to a different path, but mind the forward slash, nevermind being on Windows.

萌吟 2024-10-14 17:17:26

我解决了这个问题一整天。解决方案花了我几个小时。 如果您使用的是基于 ubuntu 或 debian 的 Linux,请首先安装 mysql-connector-java

sudo apt install libmysql-java

它将在 / 中安装 mysql-connector-java-* 链接usr/share/java/mysql-connector-java.jar

#!/bin/bash
# Path to weka.jar
CP=$CLASSPATH:/usr/share/java/:/usr/share/java/weka.jar:/usr/share/java/mysql-connector-java.jar
# start Explorer
java -cp $CP -Xmx500m weka.gui.GUIChooser

我用上面的脚本替换了 /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:

sudo apt install libmysql-java

It will install mysql-connector-java-* links in /usr/share/java/mysql-connector-java.jar

#!/bin/bash
# Path to weka.jar
CP=$CLASSPATH:/usr/share/java/:/usr/share/java/weka.jar:/usr/share/java/mysql-connector-java.jar
# start Explorer
java -cp $CP -Xmx500m weka.gui.GUIChooser

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)

檐上三寸雪 2024-10-14 17:17:26

完成 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!

毁虫ゝ 2024-10-14 17:17:26

实际上,可以提取源jar并导入到eclipse maven中,并在pom.xml中添加Mysql依赖项,然后使用参数“clean install”运行maven build,一旦完成,您将遇到很多错误,您可以忽略它们JUnit 测试然后将项目作为 Java 应用程序运行,并使用 GUI 类“weka.gui.GUIChooser”添加连接字符串并顺利进行。

pom.xml添加:

<依赖>;
  mysql;
  mysql-connector-java;
  <版本>5.1.36

<块引用>

maven安装完成后。 ![在此处输入图像描述][5] 单击资源管理器并添加您的连接字符串、用户名和
密码 jdbc:mysql://ip:端口/数据库名 ![输入图片描述

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.

pom.xml add:

<dependency>
  <groupId>mysql</groupId>
  <artifactId>mysql-connector-java</artifactId>
  <version>5.1.36</version>
</dependency>

After maven install in complete. ![enter image description here][5] Click the explorer and Add your connection string , username and
password jdbc:mysql://ip:port/databasename ![enter image description

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文