Hitachi Vantara Pentaho Community Forums
Results 1 to 25 of 25

Thread: connect weka to the mysql database

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2011
    Posts
    15

    Default connect weka to the mysql database

    Hi,
    can anybody please tell me how to connect weka to the mysql database?
    I read the chapter 13 of wekamanual but I cannot connect the explorer of weka to the my database.
    I cannot change the files DatabaseUtils.probs in weka.jar.

    Please help!
    Thanks
    Last edited by jackkk; 10-13-2011 at 01:10 PM.

  2. #2
    Join Date
    Aug 2006
    Posts
    1,741

    Default

    Hi,

    You will need to unpack the weka-src.jar file (you can use any tool for zip archives to do this). In the weka/experiment directory you will find a "DatabaseUtils.props.mysql" file. This needs to be renamed to "DatabaseUtils.props" and placed into your home directory (Weka 3.6) or into wekafiles/props in your home directory (Weka >= 3.7.2). In this props file you should only need to edit the database URL line in order to point to your MySQL server.

    Cheers,
    Mark.

  3. #3
    Join Date
    Oct 2011
    Posts
    15

    Default

    thanks.....
    I renamed the file and I put it in directory c: \program files\weka-3-6.
    When I want to connect the explorer to the my database I have the error in the box info of sql viewer of weka.
    This is what appears to me:

    connecting to:jdbc:mysql://127.0.0.1:3306/mydatabase = false
    exception: java.sql.SQLException: No suitable driver found for jdbc:mysql://127.0.0.1:3306/mydatabase

  4. #4
    Join Date
    Aug 2006
    Posts
    1,741

    Default

    Hi,

    c: \program files\weka-3-6 is the installation directory for Weka (visible to all users). Weka 3.6 will look in your home directory (as defined by the java property user.home) so that different users can have different setups for database connectivity. See the following article for where the home directory is for various OS's:

    http://en.wikipedia.org/wiki/Home_directory

    Cheers,
    Mark.

  5. #5
    Join Date
    Oct 2011
    Posts
    15

    Default

    Hi,
    I found my home directory with the command %UserProfile% in the prompt of command.
    my home directory is: c: \users\user1.
    I have to unpack the weka-src.jar file with winrar and I renamed the file DatabaseUtils.props.mysql in DatabaseUtils.props and I put it in directory c: \users\user1.
    I have always the same error in the box info of sql viewer of weka:
    connecting to:jdbc:mysql://127.0.0.1:3306/mydatabase = false
    exception: java.sql.SQLException: No suitable driver found for jdbc:mysql://127.0.0.1:3306/mydatabase

  6. #6
    Join Date
    Aug 2006
    Posts
    1,741

    Default

    You will also need the JDBC driver for MySQL - download this from the MySQL site. This jar file will need to be present in the classpath for Weka, so store the driver somewhere (it can go in the Weka installation directory if you wish) and then edit the RunWeka.ini file. At the bottom of this file you will see an example of how to make additional jar files available to Weka.

    Cheers,
    Mark.

  7. #7
    Join Date
    Apr 2016
    Posts
    1

    Default

    Hi Mark ,

    i have done all you said previously but i get this error :
    com.mysql.jdbc.exceptions.jdbc4.communicationsexception communications link failure
    The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server

    Please help!

  8. #8
    Join Date
    Aug 2006
    Posts
    1,741

    Default

    I don't think this is a Weka problem, but rather some network issue. Perhaps you have a firewall or proxy in the way or something?

    Cheers,
    Mark.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.