kettle 连接数据库报错 (错误连接数据库 [mysql] : org.pentaho.di.core.exception.KettleDatabaseException: Error occ)

问题描述

说的是没有发现org.gjt.mm.mysql.Driver驱动,故而我们下载自己mysql对应的版本。

错误连接数据库 [mysql] : org.pentaho.di.core.exception.KettleDatabaseException: 
Error occurred while trying to connect to the database

Driver class 'org.gjt.mm.mysql.Driver' could not be found, make sure the 'MySQL' driver (jar file) is installed.
org.gjt.mm.mysql.Driver


org.pentaho.di.core.exception.KettleDatabaseException: 
Error occurred while trying to connect to the database

Driver class 'org.gjt.mm.mysql.Driver' could not be found, make sure the 'MySQL' driver (jar file) is installed.
org.gjt.mm.mysql.Driver


	at org.pentaho.di.core.database.Database.normalConnect(Database.java:477)
	at org.pentaho.di.core.database.Database.connect(Database.java:373)
	at org.pentaho.di.core.database.Database.connect(Database.java:344)
	at org.pentaho.di.core.database.Database.connect(Database.java:334)
	at org.pentaho.di.core.database.DatabaseFactory.getConnectionTestReport(DatabaseFactory.java:83)
	at org.pentaho.di.core.database.DatabaseFactory.getConnectionTestResults(DatabaseFactory.java:112)
	at org.pentaho.di.core.database.DatabaseMeta.testConnectionSuccess(DatabaseMeta.java:2843)
	at org.pentaho.ui.database.event.DataHandler.testDatabaseConnection(DataHandler.java:621)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.pentaho.ui.xul.impl.AbstractXulDomContainer.invoke(AbstractXulDomContainer.java:313)
	at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:157)
	at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:141)
	at org.pentaho.ui.xul.swt.tags.SwtButton.access$500(SwtButton.java:43)
	at org.pentaho.ui.xul.swt.tags.SwtButton$4.widgetSelected(SwtButton.java:137)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
	at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
	at org.eclipse.swt.widgets.Display.sendEvent(Unknown Source)
	at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
	at org.eclipse.jface.window.Window.open(Window.java:796)
	at org.pentaho.di.ui.xul.KettleDialog.show(KettleDialog.java:80)
	at org.pentaho.di.ui.xul.KettleDialog.show(KettleDialog.java:47)
	at org.pentaho.di.ui.core.database.dialog.XulDatabaseDialog.open(XulDatabaseDialog.java:116)
	at org.pentaho.di.ui.core.database.dialog.DatabaseDialog.open(DatabaseDialog.java:61)
	at org.pentaho.di.ui.spoon.delegates.SpoonDBDelegate.newConnection(SpoonDBDelegate.java:495)
	at org.pentaho.di.ui.spoon.delegates.SpoonDBDelegate.newConnection(SpoonDBDelegate.java:482)
	at org.pentaho.di.ui.spoon.Spoon.doubleClickedInTree(Spoon.java:3096)
	at org.pentaho.di.ui.spoon.Spoon.doubleClickedInTree(Spoon.java:3066)
	at org.pentaho.di.ui.spoon.Spoon.access$1700(Spoon.java:372)
	at org.pentaho.di.ui.spoon.Spoon$26.widgetDefaultSelected(Spoon.java:6205)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
	at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
	at org.eclipse.swt.widgets.Display.sendEvent(Unknown Source)
	at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
	at org.pentaho.di.ui.spoon.Spoon.readAndDispatch(Spoon.java:1381)
	at org.pentaho.di.ui.spoon.Spoon.waitForDispose(Spoon.java:7816)
	at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:9178)
	at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:707)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.pentaho.commons.launcher.Launcher.main(Launcher.java:92)
Caused by: org.pentaho.di.core.exception.KettleDatabaseException: 
Driver class 'org.gjt.mm.mysql.Driver' could not be found, make sure the 'MySQL' driver (jar file) is installed.
org.gjt.mm.mysql.Driver

	at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:520)
	at org.pentaho.di.core.database.Database.normalConnect(Database.java:461)
	... 49 more
Caused by: java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
	at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:495)
	... 50 more

主机名       : localhost
端口           : 3306
数据库名:test

问题分析

分析上面报错原因:是org.gjt.mm.mysql路径下没有找到Driver.class,所以下载的jar包一定要包含这个路径下的Driver.class文件

所以原因有两种:

1 是你没有下载mysql 的jdbc驱动jar包

2 你下载的驱动包下不存在org.gjt.mm.mysql路径下的Driver.class文件

问题解决

所以不光是下载jar包, 还要看jar包下是否包含有org.gjt.mm.mysql该路径下的 Driver.class文件
在这里插入图片描述
把解压的这俩个jar包放到kettle …/lib下面

在这里插入图片描述

路径:D:\kettle\data-integration\lib
在这里插入图片描述

测试连接

1.选择一般模式
2.自己设置自己的连接名字,最好符合数据名设置
3.连接的名字或者ip
4.填写自己的数据库,这里的数据库在mysql里面必须用不然会报错
5.3306端口默认
6.用户信息
7.测试连接
8.成功

在这里插入图片描述

  • 2
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
引用\[1\]:这个错误是由于找不到MySQL的驱动程序引起的。请确保已安装了MySQL驱动程序的jar文件。引用\[2\]:根据引用内容,可能是在使用Pentaho Data Integration(Kettle)时出现了数据库连接异常。问题中提到的Caused by:org.pentaho.di.core.exception.KettleDatabaseExceptionPentaho Data Integration的一个异常类,表示数据库连接异常。这个异常可能是由于数据库连接配置错误数据库服务器不可用或者权限问题等引起的。 要解决这个问题,可以按照以下步骤进行排查和修复: 1. 确保已正确安装MySQL数据库,并且已经启动了MySQL服务器。 2. 检查Pentaho Data Integration中的数据库连接配置,确保连接名、IP地址、端口号、数据库名称、用户名和密码等信息都正确无误。 3. 尝试使用其他数据库客户端工具(如MySQL Workbench)连接MySQL数据库,验证数据库服务器是否可用,并确保使用的用户名和密码正确。 4. 检查MySQL驱动程序的jar文件是否正确安装,并且在Pentaho Data Integration的配置中正确引用了该jar文件。 5. 如果以上步骤都没有解决问题,可以尝试重新安装Pentaho Data Integration,并确保按照官方文档提供的步骤进行配置和使用。 希望以上信息对您有帮助。如果问题仍然存在,请提供更多详细信息以便我们进一步帮助您解决问题。 #### 引用[.reference_title] - *1* [Kettle连接MySQL错误连接数据库 [mysql_test] : org.pentaho.di.core.exception.KettleDatabaseException ...](https://blog.csdn.net/MTonj/article/details/108521077)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [(错误连接数据库 [mysql] : org.pentaho.di.core.exception.KettleDatabaseException: Error occ)](https://blog.csdn.net/qq_43674360/article/details/116270732)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值