【发布时间】:2018-02-02 11:37:11
【问题描述】:
我在我的本地计算机(一台 Windows 7 PC)上运行 Microsoft SQL Server 2014 Express。
我使用 Python 并且可以使用 SQL alchemy 毫无问题地连接到服务器(从同一台 PC)。我还可以使用 Excel 和 PowerPivot 加载项进行连接。
但是,我无法连接 Pentaho - Kettle。
- 我已从 Microsoft 下载了 JDBC 驱动程序: https://www.microsoft.com/en-gb/download/details.aspx?id=11774
- 我把文件 jre8\sqljdbc42.jar 移动到 lib 子文件夹
Pentaho 数据集成安装。我把文件放在jre8,而不是jre7,因为我的Java是JRE1.8.0_144
- 然后我将
auth\x86\sqljdbc_auth.dll中的文件复制到同一个lib 文件夹中。我拿的是 x86 文件,而不是 x64,因为 Java 在c:\Program Files (x86)\Java\jre1.8.0_144\ - 我添加“表输入”并设置连接类型 = MS SQL Server (native) 和 Access = Native (JDBC)
- 然后我将
我得到的错误信息是:
Error connecting to database [mydatabase] :org.pentaho.di.core.exception.KettleDatabaseException: Error occurred while trying to connect to the database
Error connecting to database: (using class com.microsoft.sqlserver.jdbc.SQLServerDriver) The TCP/IP connection to the host localhost, port 1433 has failed. Error: "Connection refused: connect. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".
org.pentaho.di.core.exception.KettleDatabaseException: Error occurred while trying to connect to the database
Error connecting to database: (using class com.microsoft.sqlserver.jdbc.SQLServerDriver) The TCP/IP connection to the host localhost, port 1433 has failed. Error: "Connection refused: connect. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".
我尝试了指定端口号 1433 并将其留空、使用集成安全性和手动输入我的密码、将主机名设置为 localhost 和 DESKTOP-MYNAME\SQLEXPRESS 的各种组合,但无济于事。
我已经阅读了很多关于它的讨论,但似乎没有一个相关; SQL Server 确实接受传入连接,例如来自 Python 和 SQL Alchemy。
【问题讨论】:
-
您是否关闭了 Kettle 并再次打开它,以便它读取 JDBC jar ?
-
是的。为此,我还重新启动了 PC - 没有什么比尝试通常的“IT Crowd”方法 :) 顺便说一句,正确的语法是什么?它应该是主机名= localhost吗?还是主机名 = SQL Server 的名称?
-
数据库连接是如何到达数据库的描述。所以
Host name= 托管 SQL Server 的服务器的名称,Database name= SQL 服务器架构的名称,Instance name= 使用的 SQL 服务器实例的名称,Port= SQL 服务器使用的端口 (=1443) , 用户名/密码 = 对 SQL Server 数据库具有读/写访问权限的用户。与该级别的 TCP/IP 无关!
标签: sql-server jdbc pentaho kettle