com.microsoft.sqlserver.jdbc.SQLServerException: 到主机 localhost 的 TCP/IP 连接,端口 1433 失败 [英] com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host localhost, port 1433 has failed

查看:49
本文介绍了com.microsoft.sqlserver.jdbc.SQLServerException: 到主机 localhost 的 TCP/IP 连接,端口 1433 失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不断收到此错误.我尝试了 Stack Overflow(如下)中的一种解决方案,但对我不起作用:连接到 SQL 服务器时出现 SQL 异常

I keep on getting this error. I tried one solution from Stack Overflow (below), which did not work for me: SQL Exception while connecting to SQL server

我尝试通过使用链接在 Windows 防火墙中允许端口 1433,但也没有用.请参阅在 Windows 防火墙中打开端口以进行 TCP 访问"一节.http://msdn.microsoft.com/en-us/library/ms175043.aspx

I tried allowing port 1433 in the Windows firewall by using a link, that did not work either. Refer to section "To open a port in the Windows firewall for TCP access" http://msdn.microsoft.com/en-us/library/ms175043.aspx

com.microsoft.sqlserver.jdbc.SQLServerException: TCP/IP连接到主机 localhost,端口 1433 失败.错误:"连接被拒绝:连接.验证连接属性.制作确保 SQL Server 的实例正在主机上运行,​​并且在端口接受 TCP/IP 连接.确保 TCP与端口的连接未被防火墙阻止.

com.microsoft.sqlserver.jdbc.SQLServerException: 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.

请帮我解决这个问题.

推荐答案

你需要去<代码>开始>Microsoft SQL Server >配置工具SQL Server 配置管理器

当它打开时,转到 SQL Server 配置管理器 >SQL Server 网络配置 >SQLExpress 协议.

您会在那里找到 TCP/IP 协议,如果禁用,则启用它.点击 TCP/IP,你会发现它的属性.

There you'll find the Protocol TCP/IP, if disabled then Enable it. Click on TCP/IP, you'll find its properties.

在这些属性中,删除所有 TCP 动态端口并将值 1433 添加到所有 TCP 端口,然后重新启动您的 SQL Server 服务 >SQL Server

In these properties, remove all the TCP Dynamic Ports and add value of 1433 to all TCP ports, and restart your SQL Server Services > SQL Server

大功告成.

这篇关于com.microsoft.sqlserver.jdbc.SQLServerException: 到主机 localhost 的 TCP/IP 连接,端口 1433 失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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