I need to connect mysql server from my WEKA tool for analysis some of the data. How can i make this connection in Linux platform.
I decide to use jdbc driver for this but setting up the environment is not easy for me! How do i do this?
I need to connect mysql server from my WEKA tool for analysis some of the data. How can i make this connection in Linux platform.
I decide to use jdbc driver for this but setting up the environment is not easy for me! How do i do this?
I listed the steps what found useful when configured Weka to access DB.
Installing the MySQL Driver In Ubuntu type:
sudo apt-get install libmysql-java
This will place into /usr/share/java/mysql-connector-java.jar the jars necessary to talk to MySQL (this is actually a link to the actual jar located in the same directory with the same name + version number.)
Configuring DatabaseUtils.props This part is very important. Go grab your favorite file unzipper/extractor utility and open /usr/share/java/weka.jar (actually it’s a link to a JAR of the same name with the Weka version number appended) I just use GNOME and point the file browser /usr/share/java/weka.jar from there extract: /weka/experiment/DatabaseUtils.props.mysql. Put this file into your home directory but rename it to: DatabaseUtils.props. Open this file and edit the following lines:
jdbcDriver=org.gjt.mm.mysql.Driver
jdbcURL=jdbc:mysql://server_name:3306/database_name server_name should be changed to your MySQL server (for example, ‘localhost’ or ‘dbase.cs.school.edu.org’) and database_name should be changed to the database you want to use. In this file there will also be things like: “# string, getString() = 0; –> nominal” I haven’t exactly figured out what’s going on here but if you’re going to be using varchar(N) in your database tables you need to add the following line to this table: VARCHAR=0 #that’s a zero not an “oh” And if you’re using INT (int) then add this line too: INT=5 etc…
For reference you can check the link bellow and weka.wikispaces.com you can check this tutorial source (ubuntu) https://mikebasilyan.wordpress.com/2010/02/02/weka-mysql-on-ubuntu/
Hope it helps.