Sql server Pentaho水壶:无法连接到MS SQL Server Express

Sql server Pentaho水壶:无法连接到MS SQL Server Express,sql-server,jdbc,pentaho,kettle,Sql Server,Jdbc,Pentaho,Kettle,我的本地计算机是Windows 7 PC,运行Microsoft SQL Server 2014 Express 我使用Python,可以使用SQL alchemy毫无问题地连接到服务器(从同一台PC)。我还可以使用Excel和PowerPivot加载项进行连接 然而,我无法连接到Pentaho-Ketter 我已从Microsoft下载了JDBC驱动程序: 我将文件jre8\sqljdbc42.jar移动到的lib子文件夹中 Pentaho数据集成安装。我用jre8而不是jre7获取文件,

我的本地计算机是Windows 7 PC,运行Microsoft SQL Server 2014 Express

我使用Python,可以使用SQL alchemy毫无问题地连接到服务器(从同一台PC)。我还可以使用Excel和PowerPivot加载项进行连接

然而,我无法连接到Pentaho-Ketter

  • 我已从Microsoft下载了JDBC驱动程序:
  • 我将文件jre8\sqljdbc42.jar移动到的lib子文件夹中 Pentaho数据集成安装。我用jre8而不是jre7获取文件,因为我的Java是JRE1.8.0_144
    • 然后,我在
      auth\x86\sqljdbc\u auth.dll
      中获取该文件,并将其复制到同一个lib文件夹中。我使用的是x86文件,而不是x64,因为Java位于
      c:\ProgramFiles(x86)\Java\jre1.8.0\u 144\
    • 我添加了“表输入”并设置连接类型=MS SQL Server(本机)和Access=本机(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的连接。

我运行了SQL Server 2014配置管理器,并检查了:


SQLEXPRESS-->TCP/IP的SQL Server网络配置-->协议

在协议选项卡中,我有:enabled:yes和Listen All:yes

在“IP地址”选项卡的底部IPAll下,“TCP动态端口”设置为49178。(不知道为什么)

因此我在Pentaho的“表输入”设置中将端口设置为49178。它设法找到了服务器,但在集成安全性方面出现了一个错误。因此,我将sqljdbc_auth.dll复制到C:\Program Files(x86)\Java\jre1.8.0_144…的bin和lib子文件夹中。。。。现在它工作了

如果我没有指定端口,Pentaho会尝试端口1433,但它不工作

作为参考,我在Python和SQL Alchemy中使用的连接字符串没有明确指定端口

params = '?driver=SQL+Server+Native+Client+11.0'
engine = create_engine('mssql+pyodbc://' + ServerName + '/'+ Database + params, encoding ='latin1' )
conn=engine.connect()

SQLEXPRESS-->TCP/IP的SQL Server网络配置-->协议

在协议选项卡中,我有:enabled:yes和Listen All:yes

在“IP地址”选项卡的底部IPAll下,“TCP动态端口”设置为49178

因此,我在Pentaho的“表输入”设置中将端口设置为49717


这对我也很管用

您是否关闭了水壶并再次打开它,以便它读取JDBC jar?是的。我还为此重新启动了电脑——这与尝试通常的“IT群组”方法不同:)顺便问一下,正确的语法是什么?它应该是host name=localhost吗?或者主机名=SQL Server的名称?数据库连接是对如何访问数据库的描述。因此,
主机名
=托管SQL server的服务器名,
数据库名
=SQL server架构名,
实例名
=使用的SQL server实例名,
端口
=SQL server使用的端口(=1443),用户名/密码=对SQL server数据库具有读/写访问权限的用户。这与TCP/IP在该级别上无关!这是我们通常做的事。在您习惯使用的东西上找到连接参数,然后将其复制到kettle上。我感到困惑,因为我认为SQL Alchemy也默认为端口1433