本文共 602 字,大约阅读时间需要 2 分钟。
以前一直用的是mysql连接数据库,在使用sql连接数据库的时候遇到了一些问题
The TCP/IP connection to the host localhost, port 1433 has failed. Error: Connection refused: connect. Please verify the connection properties and check that a SQL Server instance is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.
与主机localhost、端口1433的TCP/IP连接失败。错误:连接被拒绝:连接。请验证连接属性,并检查SQL Server实例是否正在主机上运行,是否在端口上接受TCP/IP连接,以及是否没有防火墙阻止到该端口的TCP连接。
百度了一下,找到了解决方法
第一步:计算机-管理
双击,确保Named Pipes
和TCP/IP
协议为已启用状态
第二:选中TCP/IP
右键–>属性–>IP地址,往下拉滚动条,查看IPALL
中TCP端口
是否为1433,不是,则改为1433
第三:重新启动
然后就可以了
转载地址:http://sjsh.baihongyu.com/