com.microsoft.sqlserver.jdbc.SQLServerException: 到主机 localhost 的 TCP/IP 连接,端口 1433 失败

编程入门 行业动态 更新时间:2024-10-25 10:27:35
本文介绍了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 访问"一节.msdn.microsoft/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" msdn.microsoft/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 连接,端口 14

本文发布于:2023-10-15 00:52:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1492754.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:端口   主机   jdbc   SQLServerException   microsoft

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!