错误:“连接被拒绝:连接.验证连接属性 [英] Error: "Connection refused: connect. Verify the connection properties

查看:22
本文介绍了错误:“连接被拒绝:连接.验证连接属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.".

我已检查 SQL Server 配置管理器 TCP/IP 已启用.但我仍然面临同样的问题.我已添加 sqljdbc4.0.jar

I have Checked the SQL Server Configuration Manager TCP/IP is Enabled.But Still I am Facing same issue.I have added sqljdbc4.0.jar

    <property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" />
    <property name="url" value="jdbc:sqlserver://localhost:1433;databaseName=Sample;" />
    <property name="username" value="someValue" />
    <property name="password" value="someValue" />
</bean>

有人能帮我解决上面的问题吗

Can Some Help me to solve the above issue

推荐答案

.感谢大家的回复.问题已经解决.按照以下步骤允许windows防火墙

.Thanks all you for your response.Issue has been Resolved.Followed the below steps to allow windows firewall

1) 在开始"菜单上,单击运行",键入 WF.msc,然后单击确定".

1) On the Start menu, click Run, type WF.msc, and then click OK.

2) 在具有高级安全性的 Windows 防火墙 的左侧窗格中,右键单击 Inbound Rules,然后单击操作窗格中的 New Rule(右上角角).在规则类型"对话框中,选择端口",然后单击下一步".

2) In the Windows Firewall with Advanced Security, in the left pane, right-click Inbound Rules, and then click New Rule in the action pane (upper right corner). In the Rule Type dialog box, select Port, and then click Next.

3) 在ProtocolPorts 对话框中,选择TCP.选择特定本地端口,然后键入数据库引擎实例的端口号,在我的例子中,我们使用默认值 1433.点击下一步.

3) In the Protocol and Ports dialog box, select TCP. Select Specific local ports, and then type the port number of the instance of the Database Engine, In my case we are using the default which is 1433. Click Next.

4) 在操作"对话框中,选择允许连接",然后单击下一步".在配置文件"对话框中,我将打开离开域"并关闭私人"和公共".然后点击下一步

4) In the Action dialog box, select Allow the connection, and then click Next. In the Profile dialog box, I am going to Leave Domain turned on and turn private and public off. Then click Next

5) 在名称"对话框中,键入 Allow SQL 1433 Inbound" 并输入相同的描述.然后单击完成"-

5) In the Name dialog box, type "Allow SQL 1433 Inbound" and for a description I am putting in the same. Then click Finish -

重新启动 SQLServer(MSSQLServer) 服务并重试.

Restart the SQLServer(MSSQLServer) Service and try Again.

这行得通

这篇关于错误:“连接被拒绝:连接.验证连接属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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