Pentaho数据集成SQL连接

我正在使用Pentaho数据集成,我试图通过MySQL连接到我的数据库,但是当我这样做,我得到这个错误…..

Error connecting to database [devdb2] : org.pentaho.di.core.exception.KettleDatabaseException: Error occured while trying to connect to the database Exception while loading class org.gjt.mm.mysql.Driver org.pentaho.di.core.exception.KettleDatabaseException: Error occured while trying to connect to the database Exception while loading class org.gjt.mm.mysql.Driver at org.pentaho.di.core.database.Database.normalConnect(Database.java:368) at org.pentaho.di.core.database.Database.connect(Database.java:317) at org.pentaho.di.core.database.Database.connect(Database.java:279) at org.pentaho.di.core.database.Database.connect(Database.java:269) at org.pentaho.di.core.database.DatabaseFactory.getConnectionTestReport(DatabaseFactory.java:86) at org.pentaho.di.core.database.DatabaseMeta.testConnection(DatabaseMeta.java:2464) at org.pentaho.ui.database.event.DataHandler.testDatabaseConnection(DataHandler.java:533) at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.pentaho.ui.xul.impl.AbstractXulDomContainer.invoke(AbstractXulDomContainer.java:329) at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:139) at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:123) at org.pentaho.ui.xul.swt.tags.SwtButton.access$500(SwtButton.java:26) at org.pentaho.ui.xul.swt.tags.SwtButton$4.widgetSelected(SwtButton.java:119) at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source) at org.eclipse.swt.widgets.EventTable.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.ui.xul.swt.tags.SwtDialog.show(SwtDialog.java:378) at org.pentaho.ui.xul.swt.tags.SwtDialog.show(SwtDialog.java:304) at org.pentaho.di.ui.core.database.dialog.XulDatabaseDialog.open(XulDatabaseDialog.java:115) at org.pentaho.di.ui.core.database.dialog.DatabaseDialog.open(DatabaseDialog.java:62) at org.pentaho.di.ui.spoon.delegates.SpoonDBDelegate.newConnection(SpoonDBDelegate.java:493) at org.pentaho.di.ui.spoon.delegates.SpoonDBDelegate.newConnection(SpoonDBDelegate.java:478) at org.pentaho.di.ui.spoon.Spoon.newConnection(Spoon.java:7770) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.pentaho.ui.xul.impl.AbstractXulDomContainer.invoke(AbstractXulDomContainer.java:329) at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:139) at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:123) at org.pentaho.ui.xul.swt.tags.SwtMenuitem.access$100(SwtMenuitem.java:27) at org.pentaho.ui.xul.swt.tags.SwtMenuitem$1.widgetSelected(SwtMenuitem.java:77) at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source) at org.eclipse.swt.widgets.EventTable.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:1183) at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:6966) at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:567) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.pentaho.commons.launcher.Launcher.main(Launcher.java:134) Caused by: org.pentaho.di.core.exception.KettleDatabaseException: Exception while loading class org.gjt.mm.mysql.Driver at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:423) at org.pentaho.di.core.database.Database.normalConnect(Database.java:352) ... 50 more Caused by: java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:414) ... 51 more 

如果我使用SQLite作为我的连接types,但它的工作原理,但没有数据返回时,我去探索它。 所以我的问题是如何让MySQL工作或使用SQLite获取数据?

我错过了一个图书馆或一个class级?

我试图从Pentaho查询MySQL数据库时遇到了同样的问题。

连接到数据库[本地MySQL数据库]时出错:org.pentaho.di.core.exception.KettleDatabaseException:尝试连接到数据库时发生错误

加载类org.gjt.mm.mysql.Driverexception

通过@ user979331扩展后,解决scheme是:

  1. 下载 最新的MySQL Java连接器/驱动程序
  2. 解压 zip文件(在我的情况下是mysql-connector-java-5.1.31.zip
  3. 复制 .jar文件( mysql-connector-java-5.1.31-bin.jar并将粘贴到您的Lib文件夹中:

    PC: C:\ Program Files \ pentaho \ design-tools \ data-integration \ lib

    Mac: / Applications / data-integration / lib

重新启动Pentaho(数据集成)并重新testingMySQL连接。

缺less驱动程序文件。

对于刚开始使用PDI的人来说,这个错误非常普遍。

对于PDI,驱动程序进入\ pentaho \ design-tools \ data-integration \ libext \ JDBC。 如果您在Pentaho套件中使用其他工具,则可能需要将驱动程序复制到这些工具的其他位置。 作为参考,以下是其他一些devise工具的相应文件夹:

  • 聚合devise器:\ pentaho \ design-tools \ aggregation-designer \ drivers
  • 元数据编辑器:\ pentaho \ design-tools \ metadata-editor \ libext \ JDBC
  • 报告devise器:\ pentaho \ design-tools \ report-designer \ lib \ jdbc
  • 架构工作台:\ pentaho \ design-tools \ schema-workbench \ drivers

如果此转换或作业将在另一个框(如testing或生产服务器)上运行,请不要忘记在部署注意事项中包含复制jar文件并重新启动PDI或Data Integration Server。

事实certificate,我将缺less一个名为mysql-connector-java-5.1.2.jar的类,我添加了这个文件夹(C:\ Program Files \ pentaho \ design-tools \ data-integration \ lib)连接和我的数据和表格出现。

除了这里的其他答案,以下是你如何在Ubuntu(14.04)上做到这一点:

sudo apt-get install libmysql-java

这会将mysql-connector-java-5.xxjar下载到/usr/share/java/ ,我相信它也会自动创build一个名为mysql-connector-java.jar的符号链接。

然后,在/your/path/to/data-integration/lib/创build一个符号链接:

ln -s /usr/share/java/mysql-connector-java.jar /your/path/to/data-integration/lib/mysql-connector-java.jar