完美解决kettle连接mysql提示Driver class org.gjt.mm.mysql.Driver could not be found的问题

时间:2024-03-14 08:27:38

使用kettle连接mysql时提示
错误连接数据库 [localhost] : 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

显然是没有安装驱动
去官网下载对应的驱动,链接如下
https://dev.mysql.com/downloads/
点击Connector/J

注意,这里要选择旧版本的驱动

完美解决kettle连接mysql提示Driver class org.gjt.mm.mysql.Driver could not be found的问题
点击"Looking for previous GA versions?"
下载后解压,将
mysql-connector-java-5.1.49.jar
放入
data-integration\lib
下即可解决问题

一开始我下载的是新版本的驱动
mysql-connector-java-8.0.20.jar
但是依然会提示找不到驱动
我们需要的是org.gjt.mm.mysql.Driver,所以便去查看了下jar包
解压mysql-connector-java-5.1.49.jar这个包后发现,根本没有
org\gjt\mm\mysql\Driver.class这个类
因此新版本并不适用于kettle(v9.0.0.0)
解压mysql-connector-java-5.1.49.jar后可以看到有
org\gjt\mm\mysql\Driver.class这个类