WEKA & MySQL Connection Setup

WEKA Explorer cannot open a connection to MySQL.

connection to: jdbc: mysql: // MYSERVER: 3306 / NAME = true

by the way: the mysql driver mysql-connector-java-5.1.14-bin is loaded and the classpath has been installed.

(User and password approved because it works with MySQL Workbench)

when you click on JButton OK (in the form "Open DB"), an error message is displayed in the message window - see image:

Error message

(the screenshot shows the shameful "no driver" error)

the weka version is 3.6.3.

any suggestions?

+4
source share
4 answers

Lost half an hour on the same problem, here is 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 the last line to:

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

Of course, you can save your piece of mysql-connector in a different way, but pay attention to the slash , which is not located in Windows.

+4
source

I solved this problem during the day. The decision took me many hours. If you are on debian based ubuntu or linux , first install mysql-connector-java to:

 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. Perhaps this can save hours for people like me. Another option is to change your desktop menu using

java -cp "/usr/share/java/mysql.jar:/usr/share/java/weka.jar" -Xmx500m weka.gui.GUIChooser

(in my case mysql.jar binds the correct driver version)

+2
source

After you finish with the CLASSPATH variable, you may need to create the “DatabaseUtlils.props” file and add the following line to it.

jdbcDriver = com.mysql.jdbc.Driver

and import it into Weka in the section "Configuring the switch database"

Hooray!

+1
source

Actually, you can extract the original jar and import into eclipse maven and add the Mysql dependency to pom.xml, than run the maven assembly with the "clean install" parameters, as soon as it is complete, you will have many errors that you can ignore - this is testing JUnit and launching the project as a Java application, and using the GUI class "weka.gui.GUIChooser" adds a connection string and a smooth swim.

pom.xml add:

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

After the installation of maven.! [enter image description here] [5] Click explorer and add the connection string, username and password jdbc: mysql: // ip: port / databasename! [enter image description

0
source

Source: https://habr.com/ru/post/1332116/


All Articles