我不断收到此错误.我尝试了 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
发布评论