如何使MS SQL Server可用于连接? [英] How can I make MS SQL Server available for connections?

查看:208
本文介绍了如何使MS SQL Server可用于连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从Java程序连接到MS SQL Server(在我的机器上运行)。我得到以下冗长的例外:

I'm trying to connect to MS SQL Server (running on my machine) from a Java program. I'm getting the following long winded exception:

线程main中的异常com.microsoft.sqlserver.jdbc.SQLServerException:TCP /到主机localhost,端口1433的IP连接失败。错误:连接被拒绝:连接。验证连接属性,检查主机上是否正在运行SQL Server实例并接受端口上的TCP / IP连接,并且没有防火墙阻止与端口的TCP连接。

当我检查属性并在MS SQL的对象资源管理器中单击查看连接属性时,我发现服务器不可用。这似乎与异常消息有关。

When I check "Properties" and click "View Connection Properties" in the Object Explorer of MS SQL, I find that the "Server is Unavailable." This seems possibly related to the exception message.

如何使服务器可用?

编辑:

我正在使用SQL Server 2008,现在我已经启用了TCP / IP,并重新启动了我的实例。我仍然被告知服务器不可用。

I am using SQL Server 2008, and I have now enabled TCP/IP, and restarted my instance. I am still told that "Server is unavailable."

还有其他想法吗?

推荐答案

我也遇到了这个问题。
MSKB文章适用于SQL Server 2005。

I ran into this problem as well. The MSKB article applies to SQL server 2005.

由于SQL Server表面区域配置工具已被删除而不是Facets - 这不是对我来说很明显。

As the "SQL Server Surface Area Configuration" tool has been dropped in lieu of "Facets" - this wasn't obvious to me.

我通过设置TCPAll端口并启用相关IP解决了这个问题。

I resolved this by setting the TCPAll port and enabling the relevant IP.


  1. 打开Sql Server配置管理器(开始 - >程序 - > Microsoft SQL Server 2008 - >配置工具)

  1. Open the Sql Server Configuration Manager (Start -> Programs -> Microsoft SQL Server 2008 -> Configuration Tools)

展开SQL Server网络配置 - > [您的服务器实例]

Expand SQL Server Network Configuration -> [Your Server Instance]

双击TCP / IP

Double click TCP/IP


  • 协议下:

确保已启用

IP地址

滚动到底部并在IPAll下设置TCP端口,(默认为1433)

Scroll to the bottom and set the TCP Port under IPAll, (1433 by default)

找到您要连接的IP地址,并将已启用活动设置为

Find the IP address you want to connect to and set Enabled and Active to Yes

这篇关于如何使MS SQL Server可用于连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆