连接到数据库时出错:(使用类 org.gjt.mm.mysql.Driver)

2023-12-05

我正在尝试在 Pentaho 5.3.0.0-213 中建立到本地主机上 mysql 的连接。我使用的是运行 OS 10.10.2 的 Mac。我可以使用 Sequel Pro 连接到数据库,并阅读了本网站(以及其他网站)上已经给出的所有答案,并下载了 mysql-connector-java-5.1.34-bin.jar 并将其复制到 data-integration/lib仍然得到同样的错误。

欢迎大家提出意见。

整个错误信息如下: 连接到数据库 [localhost_con] 时出错:org.pentaho.di.core.exception.KettleDatabaseException: 尝试连接数据库时发生错误

连接到数据库时出错:(使用类 org.gjt.mm.mysql.Driver) 通讯链路故障

最后一次成功发送到服务器的数据包是在 0 毫秒前。驱动程序尚未收到来自服务器的任何数据包。

org.pentaho.di.core.exception.KettleDatabaseException: 尝试连接数据库时发生错误

连接到数据库时出错:(使用类 org.gjt.mm.mysql.Driver) 通讯链路故障

最后一次成功发送到服务器的数据包是在 0 毫秒前。驱动程序尚未收到来自服务器的任何数据包。

    at org.pentaho.di.core.database.Database.normalConnect(Database.java:417)
    at org.pentaho.di.core.database.Database.connect(Database.java:357)
    at org.pentaho.di.core.database.Database.connect(Database.java:310)
    at org.pentaho.di.core.database.Database.connect(Database.java:300)
    at org.pentaho.di.core.database.DatabaseFactory.getConnectionTestReport(DatabaseFactory.java:80)
    at org.pentaho.di.core.database.DatabaseMeta.testConnection(DatabaseMeta.java:2685)
    at org.pentaho.ui.database.event.DataHandler.testDatabaseConnection(DataHandler.java:546)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.pentaho.ui.xul.impl.AbstractXulDomContainer.invoke(AbstractXulDomContainer.java:313)
    at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:157)
    at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:141)
    at org.pentaho.ui.xul.swt.tags.SwtButton.access$500(SwtButton.java:43)
    at org.pentaho.ui.xul.swt.tags.SwtButton$4.widgetSelected(SwtButton.java:138)
    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.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.notifyListeners(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:389)
    at org.pentaho.ui.xul.swt.tags.SwtDialog.show(SwtDialog.java:318)
    at org.pentaho.di.ui.core.database.dialog.XulDatabaseDialog.open(XulDatabaseDialog.java:116)
    at org.pentaho.di.ui.core.database.dialog.DatabaseDialog.open(DatabaseDialog.java:59)
    at org.pentaho.di.ui.spoon.delegates.SpoonDBDelegate.editConnection(SpoonDBDelegate.java:87)
    at org.pentaho.di.ui.spoon.Spoon.doubleClickedInTree(Spoon.java:3096)
    at org.pentaho.di.ui.spoon.Spoon.doubleClickedInTree(Spoon.java:3031)
    at org.pentaho.di.ui.spoon.Spoon.access$2400(Spoon.java:347)
    at org.pentaho.di.ui.spoon.Spoon$27.widgetDefaultSelected(Spoon.java:6121)
    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.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.notifyListeners(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:1316)
    at org.pentaho.di.ui.spoon.Spoon.waitForDispose(Spoon.java:7979)
    at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:9310)
    at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:654)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.pentaho.commons.launcher.Launcher.main(Launcher.java:92)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at apple.launcher.LaunchRunner.run(LaunchRunner.java:116)
    at apple.launcher.LaunchRunner.callMain(LaunchRunner.java:51)
    at apple.launcher.JavaApplicationLauncher.launch(JavaApplicationLauncher.java:52)
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:561)
    at org.pentaho.di.core.database.Database.normalConnect(Database.java:400)
    ... 60 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:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
    at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1036)
    at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:338)
    at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2232)
    at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2265)
    at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2064)
    at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:790)
    at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
    at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:395)
    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:185)
    at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:543)
    ... 61 more
Caused by: java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:382)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:241)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:228)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:431)
    at java.net.Socket.connect(Socket.java:527)
    at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:213)
    at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:297)
    ... 76 more

主机名:本地主机 端口:3306 数据库名称:my_learning_sql


我见过这个问题,具体取决于数据库的版本和 MySQL 驱动程序的版本。我正在使用 mysql-connector-java-5.1.17.jar 并且必须升级到 mysql-connector-java-5.1.34-bin.jar 才能让我的工作正常。也许你的问题是相反的,你可以将你的驱动程序降级到 mysql-connector-java-5.1.17.jar 来修复你的问题?

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

连接到数据库时出错:(使用类 org.gjt.mm.mysql.Driver) 的相关文章

  • 两个日期之间有多少周

    我的数据库 MySQL 中有开始日期和结束日期 我怎样才能得到答案 这两个日期有多少周 或天 mysql 或 php 例如我有这样的数据库 开始并 会停2009 12 17 2009 12 242009 12 12 2009 12 26 更
  • 不同的数据库使用不同的名称引用吗?

    例如 mysql引用表名使用 SELECT FROM table name 注意 其他数据库是否使用不同的字符来引用其表名 这种引号的使用称为分隔标识符 它是 SQL 的重要组成部分 因为否则您将无法使用以下标识符 例如表名和列名 包含空格
  • 如何限制 SQLite / MySQL 中的列值

    我想限制表中的列值 例如 列值只能是car or bike or van 我的问题是如何在 SQL 中实现这一点 在数据库端执行此操作是一个好主意还是应该让应用程序限制输入 我还打算在将来添加或删除更多值 例如 truck 我使用的数据库类
  • 如何在MySQL查询结果中显示序号

    我有一些简单的查询 SELECT foo bar FROM table 我想你现在的结果是什么样的 我想要做的是根据查询结果中出现的数据数量来显示一些序列号 就像AUTO INCREMENT 这并不意味着我想出示身份证 我想要的结果是这样的
  • 使用 JdbcTemplate 进行动态查询

    我有一个关于使用 JdbcTemplate 进行动态查询的问题 我的代码如下 String insertQueries INSERT INTO tablename StringJoiner joiner new StringJoiner S
  • 将波斯语字符串发送到mysql

    我正在尝试发送Persian字符串到mysql数据库 但它将数据保存为这样的 D8 AC D8 AF DB 8C D8 AF 英文字符串没有问题 var new this val ajax url url new type GET succ
  • 从mysql数据库读取pdf文件

    我正在使用这个例子http www php mysql tutorial com wikis mysql tutorials uploading files to mysql database aspx http www php mysql
  • InnoDB vs. MyISAM 插入查询时间

    我有一个大型 MySQL 表 约 1000 万行 6 5G 用于读取和写入 它是MyISAM 由于MyISAM 的所有表写入锁 我获得了很多锁 我决定尝试迁移到 InnoDB 推荐用于读 写表 它只锁定写入时的特定行 转换后 我测试了插入语
  • JS 无法查询 MySQL 数据库。错误:connection.query 不是函数

    尝试查询我的 mySQL 数据库 但我不能 因为我得到了TypeError connection query is not a function错误 有谁知道为什么吗 我不知道为什么会发生这种情况 数据库 js const fs requi
  • MySQL - 如何按相关性排序? INNODB表

    我在一个名为 cards 的 INNODB 表中有大约 20 000 行 所以 FULLTEXT 不是一个选项 请考虑这张表 id name description 1 John Smith Just some dude 2 Ted Joh
  • 我不小心锁定了 MySQL 的 root

    我在 OS X 上使用 MySQL 并使用删除了所有 root 用户DROP USER 然后我又添加了其中一些并做了GRANT ALL on to root localhost 然后在验证确实是的之后注销 我可以登录并执行一些特权操作 不幸
  • 在带有 OR 条件的 LEFT JOIN 中使用索引

    考虑以下查询 SELECT FROM table1 LEFT JOIN table2 ON table2 some primary key table1 some primary key LEFT JOIN table3 ON table3
  • 将表与同一个表的前一条记录连接起来

    我有一个包含历史记录的表 由主表中的多个触发器发布到那里 我想在历史表上创建一个 select 语句 其中每个记录都由其先前的记录 由相同的 LineID 和最高的 ActionDate 标识 连接 这样我就可以提取这两者之间的差异 我尝试
  • MySQL 多个 IN 条件对同一个表进行子查询

    我有多个带有子查询的 IN 条件 SELECT S name S email FROM something S WHERE 1 NOT IN SELECT id FROM tags WHERE somethingId S id AND 2
  • 工厂模式数据库连接

    我正在尝试使用 MySQL 实现数据库连接上的工厂模式 SQL Server 面临奇怪的错误 你调用的对象是空的 在 SQL 命令对象上 internal class SqlServerDB IDatabase private SqlCon
  • 数据太长,导致列错误(包含国家字符)

    我必须移植一些DBS变成独立的MySQL版本 5 0 18运行于Windows 7 64 位我遇到了一个困扰我的问题 如果我尝试将任何国家 Unicode 字符插入varchar我收到错误 ERROR 1406 22001 Data too
  • 无效的 PDO 查询不会返回错误

    下面的第二条 SQL 语句在 phpMyAdmin 中返回错误 SET num 2000040 INSERT INTO artikel artikel nr lieferant nr bezeichnung 1 bezeichnung 1
  • ON DUPLICATE KEY UPDATE 的自动增量过多

    我有一个包含列的基本表 id 主要是AI 名称 唯一 etc 如果唯一列不存在 则插入该行 否则更新该行 INSERT INTO pages name etc VALUES bob randomness ON DUPLICATE KEY U
  • 在 MySQL 中搜索多个单词

    我使用 HTML 表单来允许用户查找数据库表中的条目
  • 我的数据库有错误

    创建表时如下 create table Ticket ticket id integer not null primary key AirlineName varchar not null CustomerName varchar from

随机推荐