Kettle9:异常处理

环境: Pentaho-Data-Integration-9.0 + WIN10 + mysql8.0.37.

 

-- 创建用户,所有主机能登陆
CREATE USER 'hibuser'@'%' IDENTIFIED BY 'password';

# if mysql8
GRANT ALL PRIVILEGES ON test.* TO 'hibuser'@'%' WITH GRANT OPTION;

 

1、连接 MYSQL8.0.37 失败

错误连接数据库 [mysql8] : org.pentaho.di.core.exception.KettleDatabaseException:

Error occurred while trying to connect to the database

 

Error connecting to database: (using class org.gjt.mm.mysql.Driver)

Unknown database 'mysql8'

 

 

org.pentaho.di.core.exception.KettleDatabaseException:

Error occurred while trying to connect to the database

 

Error connecting to database: (using class org.gjt.mm.mysql.Driver)

Unknown database 'mysql8'

 

 

解决方式:

1)在Kettle数据链接配置目录E:\data-integration\simple-jndi\jdbc.properties配置添加链接MYSQL8的配置信息。注意MYSQL8 的连接驱动是 com.mysql.cj.jdbc.DriverMYSQL5驱动是 com.mysql.jdbc.Driver

 

 

MYSQL8/type=javax.sql.DataSource

MYSQL8/driver=com.mysql.cj.jdbc.Driver

MYSQL8/url=jdbc:mysql://localhost:3306/hibernate?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai

MYSQL8/user=hibuser

MYSQL8/password=password

2)数据库连接编辑窗口中,连接类型选择=MySQL,连接方式=JNDI , JNDI名称要与JDBC.PROPERTIES配置名称一致区分大小。

 

 

 

2

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION SQL_SELECT_LIMIT=DEFAULT' at line 1

 

 

 

原因:多个版本驱动在LIB库中干扰(mysql-connector-java-5.1.17.jarmysql-connector-java-8.0.22.jar)。

解决方式:删除其中一个版本即可。本例保留mysql-connector-java-8.0.22.jar。 

posted @ 2024-08-14 07:30  samrv  阅读(44)  评论(0编辑  收藏  举报