离职交接的时候,发现对方kettle链接数据库报错。费了不少时间才解决这个问题,记录下,希望对后面遇到这个问题的有帮助
报错原文:
错误连接数据库 [p] : 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 successfully received from the server was 5 milliseconds ago. The last packet sent successfully to the server was 3 milliseconds ago.
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 successfully received from the server was 5 milliseconds ago. The last packet sent successfully to the server was 3 milliseconds ago.
解决过程
碰到这个报错,第一就是是不是jar包问题。因为我之前链接数据库报错(报错内容不一样)就是因为jar包,将jar包换成mysql-connector-java-5.1.48.jar后,发现还是报错
后面通过百度:
- 大多数都是我上面第一种处理方式,没什么用
- 有说是360将其屏蔽了的,将其添加的白名单,我试了,对我当前的情况没什么用
- 后面将找不到原因,就猜测是不是JDK版本引起的,遂将我本地的JDK拷过去,真的解决了问题
解决方式
更好jDK版本
原先的JDK是

后面换成

解决了问题。
最后:其实我也有点怀疑不是JDK版本问题,还是OpenJDK和JDK实际是有区别导致的??
本文记录了一次使用Kettle连接数据库时遇到的错误及解决过程。错误表现为无法建立通讯链接,通过更换JDK版本最终解决了问题。

873

被折叠的 条评论
为什么被折叠?



