问题描述

说的是没有发现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.成功

在这里插入图片描述

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐