ETL-kettle报错--org.gjt.mm.mysql.Driver

细节:

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)
Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

    at org.pentaho.di.core.database.Database.normalConnect(Database.java:472)
    at org.pentaho.di.core.database.Database.connect(Database.java:370)
    at org.pentaho.di.core.database.Database.connect(Database.java:341)
    at org.pentaho.di.core.database.Database.connect(Database.java:331)
    at org.pentaho.di.ui.trans.steps.update.UpdateDialog.getSchemaNames(UpdateDialog.java:912)
    at org.pentaho.di.ui.trans.steps.update.UpdateDialog.access$1200(UpdateDialog.java:76)
    at org.pentaho.di.ui.trans.steps.update.UpdateDialog$15.widgetSelected(UpdateDialog.java:543)
    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.trans.steps.update.UpdateDialog.open(UpdateDialog.java:561)
    at org.pentaho.di.ui.spoon.delegates.SpoonStepsDelegate.editStep(SpoonStepsDelegate.java:120)
    at org.pentaho.di.ui.spoon.Spoon.editStep(Spoon.java:8662)
    at org.pentaho.di.ui.spoon.trans.TransGraph.editStep(TransGraph.java:3293)
    at org.pentaho.di.ui.spoon.trans.TransGraph.mouseDoubleClick(TransGraph.java:785)
    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.trans.steps.update.UpdateDialog.open(UpdateDialog.java:561)
    at org.pentaho.di.ui.spoon.delegates.SpoonStepsDelegate.editStep(SpoonStepsDelegate.java:120)
    at org.pentaho.di.ui.spoon.Spoon.editStep(Spoon.java:8662)
    at org.pentaho.di.ui.spoon.trans.TransGraph.editStep(TransGraph.java:3293)
    at org.pentaho.di.ui.spoon.trans.TransGraph.mouseDoubleClick(TransGraph.java:785)
    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:7817)
    at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:9179)
    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:
Error connecting to database: (using class org.gjt.mm.mysql.Driver)
Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

    at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:583)
    at org.pentaho.di.core.database.Database.normalConnect(Database.java:456)
    ... 43 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
    at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1116)
    at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:344)
    at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2333)
    at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2370)
    at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2154)
    at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:792)
    at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
    at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:381)
    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305)
    at java.sql.DriverManager.getConnection(DriverManager.java:664)
    at java.sql.DriverManager.getConnection(DriverManager.java:208)
    at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:567)
    ... 44 more
Caused by: java.net.UnknownHostException: 印度rsrush-香港从库
    at java.net.InetAddress.getAllByName0(InetAddress.java:1280)
    at java.net.InetAddress.getAllByName(InetAddress.java:1192)
    at java.net.InetAddress.getAllByName(InetAddress.java:1126)
    at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:247)
    at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:294)
    ... 59 more

报错细节

解释:

org.gjt.mm.mysql.Driver 是早期的驱动名称,后来就改名为com.mysql.jdbc.Driver,现在一般都推荐使用com.mysql.jdbc.Driver。

在最新版 本的mysql jdbc驱动中,为了保持对老版本的兼容,仍然保留了org.gjt.mm.mysql.Driver,但是实际上 org.gjt.mm.mysql.Driver中调用了com.mysql.jdbc.Driver,因此现在这两个驱动没有什么区别。

其他说法:

org.gjt.mm.mysql.Driver是当时最好的MySQL?

JDBC,但不是MySQL公司的,然后MySQL将MM的JDBC驱动 收为官方的JDBC驱动,所以将驱动的package也该了,但还保留了org.gjt.mm.mysql.Driver这个路径的引用,也就是你使用新 版的JDBC驱动时还可以通过这个来引用,你打开下载的新版JDBC驱动的jar文件可以看到,只有一个文件的目录是org.gjt.mm.mysql, 就是为了兼容而设计的。

源码查看:org.gjt.mm.mysql.Driver中的除打包之外的代码如下

public class Driver extends com.mysql.jdbc.Driver {
    // ~ Constructors

    public Driver() throws SQLException {
        super();
    }
}
所以这个Driver继承了com.mysql.jdbc.Driver并且直接使用了它的构造方法,并无其他修改,所以二者完全一样,并无区别,至于什么历史原因都不重要了,反正二者一样即可
为和oracle等驱动样式一样,所以我选择写com.mysql.jdbc.Driver.

解决方法:安装Mysql驱动。

1. Mysql官网下载对应驱动;

  https://dev.mysql.com/downloads/file/?id=468318%20

2. 将驱动放在如下位置:

  1. \pdi-ce-7.1.0.0-12\data-integration\lib

  2. \pdi-ce-7.1.0.0-12\data-integration\libswt\win64:(64位系统)

原文地址:https://www.cnblogs.com/wqbin/p/12629580.html

时间: 2024-11-07 05:09:33

ETL-kettle报错--org.gjt.mm.mysql.Driver的相关文章

kettle 连接 mysql 出错 Driver class &#39;org.gjt.mm.mysql.Driver&#39; could not be found, make sure the ……

解决办法:1: 首先,到官网下载mysql-connector-java. 2: 把驱动文件放置在data-integration\lib\ 目录下 kettle 连接 mysql 出错 Driver class 'org.gjt.mm.mysql.Driver' could not be found, make sure the --

org.gjt.mm.mysql.Driver与com.mysql.jdbc.Driver区别

org.gjt.mm.mysql.Driver 是早期的驱动名称,后来就改名为com.mysql.jdbc.Driver,现在一般都推荐使用com.mysql.jdbc.Driver.在最新版 本的mysql jdbc驱动中,为了保持对老版本的兼容,仍然保留了org.gjt.mm.mysql.Driver,但是实际上 org.gjt.mm.mysql.Driver中调用了com.mysql.jdbc.Driver,因此现在这两个驱动没有什么区别. 又如其它说法: org.gjt.mm.mysql

java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver错误在eclipse中的解决方法

在Eclipse中学习Java和数据库的连接调试程序过程中爆出java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver错误.虽然在classpath中已经添加了相关的路径,但是在Eclipse的这个工程中没有添加. 解决办法是工程名上点击右键-Properties(属性)-Java Build Path(Java构建路径)-Libraries()-Add External JARs(添加JAR)-找到一个mysql-connector-j

org.gjt.mm.mysql.Driver和com.mysql.jdbc.Driver的区别

最近遇到了个问题,看一些示例代码连接数据库有的用org.gjt.mm.mysql.Driver,有的用com.mysql.jdbc.Driver,那到底这俩有什么区别呢? "org.gjt.mm.mysql.Driver 是当时最好的MySQL JDBC,但不是MySQL公司的,然后MySQL将MM的JDBC驱动收为官方的JDBC驱动,所以将驱动的package也该了,但还保留了org.gjt.mm.mysql.Driver这个路径的引用,也就是你使用新版的JDBC驱动时还可以通过这个来引用,你

com.mysql.jdbc.Driver和org.gjt.mm.mysql.Driver的疑问

通过查看源码,发现原来org.git.mm.mysql.Driver是com.mysql.jdbc.Driver的子类: public class Driver extends com.mysql.jdbc.Driver { /** * Creates a new instance of Driver * * @throws SQLException * if a database error occurs. */ public Driver() throws SQLException { su

Mysql报错 Cannot load from mysql.proc

Auth: Jin Date: 20140716 mysql --default-character-set utf8 -h127.0.0.1 -uroot -p < account-20140716-1.sql ERROR 1548 (HY000) at line 57: Cannot load from mysql.proc. The table is probably corruptedmysql> SHOW PROCEDURE status; ERROR 1548 (HY000): C

sql执行报错--This version of MySQL doesn&#39;t yet support &#39;LIMIT &amp; IN/ALL/ANY/SOME subquery&#39;

问题: 不支持使用 LIMIT 子句的 IN/ALL/ANY/SOME 子查询,即是支持非 IN/ALL/ANY/SOME 子查询的 LIMIT 子查询. 解决: 将语句:select * from table where id in (select id from table limit 0,10) 变更为:select * from table where id in (select t.id from (select * from table limit 0,10)as t) sql执行报

mysql在导入大数据库的时候,报错ERROR 2006 (HY000): MySQL server has gone away

或者,报错信息: ERROR 2005 (HY000): Unknown MySQL server host '10997107101114' (0)ERROR:Can't connect to the server No connection. Trying to reconnect... ======================= 解决办法: mysql> show global variables like 'max_allowed_packet'; mysql> set globa

yum方式安装mysql报错找不到mysql.sock

yum方式安装mysql省去了源代码包安装的许多步骤,但是有时会遇见mysql yum包装完mysql之后,在启动mysql服务时,启动不了的问题,报错: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2),找不到mysql.sock文件,mysql.sock文件是安装mysql之后初始化数据库之后才会出现的,因此在安装完包之后,做一下步骤: 添加 mysqld 服务. /sbin/chkconfig