Kettle9:異常處理

samrv發表於2024-08-14

環境: Pentaho-Data-Integration-9.0 + WIN10 .

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