weka mysql database connection error

Copyright: copyright reserved by the authors, are reproduced in any form, please indicate the source. https://blog.csdn.net/xiaokui9/article/details/85046771

1、unable to find a suitable driver for jdbc

The method of attempts in the following order

(1) Add the mysql-connector-java-8.0.12.jar file to the% JAVA_HOME% \ lib directory and added to the classpath. Did not work, this was later deleted, other entries are reserved behind.

(2) add APP user, not necessarily to find the user you want to add APP on the book, using the root account can log on.

(3) modifications weka RunWeka.ini file directory, in the end, the cp =% CLASSPATH% to cp =% CLASSPATH%; C: \ Weka-3-8 \ lib \ mysql-connector-java-8.0.12. jar

(4) The DatabaseUtils.props file copied from a file weka.jar weka to the install directory.

(5) Add the mysql-connector-java-8.0.12.jar file to lib file in the folder directory weka (To create a new) in.

(6) Add the mysql-connector-java-8.0.12.jar file to the C: \ Java \ jre1.8.0_171 \ lib \ under ext \ directory.

(7) Add the mysql-connector-java-8.0.12.jar file to the% JAVA_HOME% \ jre \ lib \ ext directory under. Add classpath:% JAVA_HOME% \ jre \ lib \ ext \ mysql-connector-java-8.0.12.jar;% WEKA_HOME% \ lib \ mysql-connector-java-8.0.12.jar

Finally, restart the database connection is no longer reported this wrong, reported the following error

 

2、java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)

Execute the following command in the database:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY "yourpassword";
FLUSH PRIVILEGES;

 

3. Other

After weka.jar in weka / experiment / DatabaseUtils.props file modifications will be replaced DatabaseUtils.props original contents DatabaseUtils.props.mysql, modify the following:

# JDBC driver (comma-separated list)
jdbcDriver=com.mysql.jdbc.Driver

# database URL
jdbcURL=jdbc:mysql://127.0.0.1:3306/weka

Guess you like

Origin blog.csdn.net/xiaokui9/article/details/85046771
Recommended