Weka accessing MySQL database

Source: Internet
Author: User
Tags mysql host
When you use Experimenter in Weka to connect to the Mysql database, the default link is jdbc: idbexperiments:

When you use Experimenter in Weka to connect to the Mysql database, the default link is jdbc: idb = experiments:

When you use Experimenter in Weka to connect to the Mysql database, the default link is:

Jdbc: idb = experiments. GP

Change it:

Jdbc: mysql: // 222.35.250.58: 3306/labin_ultimate_original

(Mysql host and database names need to be set according to the actual situation)

An error still occurs:

Exception: java. SQL. SQLException: No suitable driver found for jdbc: mysql...

This is because Weka does not find the JDBC driver.

Even from

Download the JDBC driver and install it (set CLASSPATH to the specified bin. jar file.

View the source code of DatabaseUtils. prop. The configuration is as follows:

# The comma-separated list of jdbc drivers to use

# JdbcDriver = RmiJdbc. jdbc driver, jdbc. idbDriver

# JdbcDriver = jdbc. idbDriver

JdbcDriver = RmiJdbc. connector Driver, jdbc. idbDriver, org. gjt. mm. mysql. Driver, com. mckoi. JDBCDriver, org. hsqldb. jdbcDriver

# JdbcDriver = org. gjt. mm. mysql. Driver

# The url to the experiment database

# JdbcURL = jdbc: rmi: // expserver/jdbc: idb = experiments. GP

JdbcURL = jdbc: idb = experiments. GP

# JdbcURL = jdbc: mysql: // mysqlserver/username

Now we can see the cause: Weka only sets org. gjt. mm. mysql. Driver as the JDBC Driver, and does not set com. mysql. jdbc. Driver!

Download the Driver of org. git. mm. mysql. Driver and install it.

Or change the jdbcDriver configuration under the experiment directory:

JdbcDriver = RmiJdbc. jdbc Driver, jdbc. idbDriver, org. gjt. mm. mysql. Driver, com. mckoi. JDBCDriver, org. hsqldb. jdbcDriver, com. mysql. jdbc. Driver

(Added the com. mysql. jdbc. Driver)

In fact, it is inconvenient to use the default Weka settings. It is best to modify all the configurations to the configuration that matches your needs and then package them for running.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.