美文网首页
数据库迁移工具Kettle连接Mysql数据库报错:Driver

数据库迁移工具Kettle连接Mysql数据库报错:Driver

作者: 羋学僧 | 来源:发表于2021-08-16 10:14 被阅读0次

    数据库迁移工具Kettle连接Mysql数据库报错:Driver class ‘org.gjt.mm.mysql.Driver‘ could not be found, make sure the解决

    报错信息:

    错误连接数据库 [test1] : 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: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.core.database.DatabaseFactory.getConnectionTestReport(DatabaseFactory.java:80)
        at org.pentaho.di.core.database.DatabaseMeta.testConnection(DatabaseMeta.java:2783)
        at org.pentaho.di.ui.core.database.dialog.DatabaseDialog.test(DatabaseDialog.java:110)
        at org.pentaho.di.ui.core.database.wizard.CreateDatabaseWizardPage2.test(CreateDatabaseWizardPage2.java:157)
        at org.pentaho.di.ui.core.database.wizard.CreateDatabaseWizardPage2$3.widgetSelected(CreateDatabaseWizardPage2.java:147)
        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.core.database.wizard.CreateDatabaseWizard.createAndRunDatabaseWizard(CreateDatabaseWizard.java:131)
        at org.pentaho.di.ui.trans.step.BaseStepDialog$3.widgetSelected(BaseStepDialog.java:709)
        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.tableinput.TableInputDialog.open(TableInputDialog.java:436)
        at org.pentaho.di.ui.spoon.delegates.SpoonStepsDelegate.editStep(SpoonStepsDelegate.java:127)
        at org.pentaho.di.ui.spoon.Spoon.editStep(Spoon.java:8766)
        at org.pentaho.di.ui.spoon.trans.TransGraph.editStep(TransGraph.java:3217)
        at org.pentaho.di.ui.spoon.trans.TransGraph.mouseDoubleClick(TransGraph.java:783)
        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:1366)
        at org.pentaho.di.ui.spoon.Spoon.waitForDispose(Spoon.java:8022)
        at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:9277)
        at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:692)
        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:497)
        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:515)
        at org.pentaho.di.core.database.Database.normalConnect(Database.java:456)
        ... 44 more
    Caused by: java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:490)
        ... 45 more
    
    主机名       : 127.0.0.1
    端口           : 3306
    数据库名:heroes
    

    1.下载连接驱动包(根据Mysql版本下载):

    Java 连接 MySQL 需要驱动包,MySQL驱动包官网下载地址

    要根据自己的数据库版本来下载

    2.解压Java连接Mysql 8.0驱动包

    解压后取出mysql-connector-java.jar包(这里驱动包有版本号)。放到kettle的lib目录下面。

    3.重启Kettle并测试连接

    4.还是失败

    5.下载

    6.替换

    7.重启Kettle并测试连接成功

    相关文章

      网友评论

          本文标题:数据库迁移工具Kettle连接Mysql数据库报错:Driver

          本文链接:https://www.haomeiwen.com/subject/frdpbltx.html