Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WEKA & MySQL Setup a connection

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 ?

like image 519
mnemonic Avatar asked Dec 14 '10 16:12

mnemonic


2 Answers

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.

like image 142
Alex R Avatar answered Oct 12 '22 11:10

Alex R


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)

like image 41
Rutrus Avatar answered Oct 12 '22 11:10

Rutrus