How to connect mysql databases in weka?

I want to use my mysql databases in weka for data analysis. i download mysql-connector-java-5.0.8-bin.jar and put this in the weka folder in the Program Files folder and add this path to the path to the system variables, but when I open the weka explorer and click openDB, I don’t know what I have to write in the url text box, I do not know what should I do? the error i saw:

database connection problem: no suitable driver!

Please give me general guidance, thanks in advance.

+4
source share
4 answers

add mysql-connector-java-5.1.12-bin.jar to CLASSPATH. or put it in the weka folder, go to the weka installation folder and run the command:

% java_home% / bin / java -Xmx300M -cp ".; weka.jar; mysql-connector-java-5.1.12-bin.jar;" weka.gui.GUIChooser

then click "Open" and

  • enter the correct user password
  • enter url: jdbc: mysql: // localhost: 3306 / DATABASENAME

Click Run. The results window should display the results.

+2
source

For Weka 3.7.10, the classpath system environment variable is not taken into account (according to Windows 7). The only working approach for me was to change the RunWeka.ini file from the Weka installation folder as follows: the cp= parameter was changed to:

f =% CLASSPATH%, g: /Programs/jdbc/mysql-connector-java-5.1.26/mysql-connector-java-5.1.26-bin.jar

whereas the %CLASSPATH%; setting was originally set %CLASSPATH%; . It makes no sense, but at work.

+1
source

find some introduction to WEKA and the environment variable: http://weka.wikispaces.com/CLASSPATH

0
source

Copy mysql-connector-java-XXXX-bin.jar to / usr / share / java / unizip / usr / share / java / weka.jar

edit: /usr/share/java/weka/experiment/DatabaseUtils.props

add: jdbcDriver = com.mysql.jdbc.Driver jdbcURL = jdbc: mysql: // localhost: 3306 / test (with your server)

add export shell CLASSPATH = / usr / share / java / mysql-connector-java-XXXX-bin.jar: export CP = / usr / share / java / mysql-connector-java-XXXX-bin.jar :: / usr / share / java /: / usr / shared / java / weka.jar

execute weka:

java -cp $ CP -Xmx500m weka.gui.explorer.Explorer

Done

0
source

All Articles