欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 运维知识 > 数据库 >内容正文

数据库

“SQL Server does not allow remote connections”错误的解决

发布时间:2025/4/5 数据库 52 豆豆
生活随笔 收集整理的这篇文章主要介绍了 “SQL Server does not allow remote connections”错误的解决 小编觉得挺不错的,现在分享给大家,帮大家做个参考.
安装DNN 4.8的时候出现这个错误

Connection Error(s):

Index #: 0
Source: .Net SqlClient Data Provider
Class: 20
Number: 53
Message: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

因为
对于SQL Server 2005 Express Edition 和 SQL Server 2005 Developer Edition 默认的设置是不允许 remote connections 的,参考MSDN的文档可以更改设置:http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277

我的机器上安装了SQL 2000 的Personal版本和SQL 2005 Express(随VS自动安装的),我使用的是SQL 2000的Personal版本,应该不存在这个问题。在研究一番之后找到了答案。

在没有安装SQL 2005 Express之前,我的机器上只有一个SQL Server,我一般在连接字符串里使用local来指明使用本地的SQL 2000 Personal 版本。安装Express版后,机器上会存在两个SQL 的实例。如图:


一个是LAND001(我的计算机名),一个是LAND001\SQLEXPRESS。这个时候,如果还是用local来指代SQL Server Personal版本,DNN安装是不会找Personal版,而是找到 Express版。

解决办法,连接字符串中使用SQL的实例名准确指定要使用的SQL Server,比如LAND001。

转载于:https://www.cnblogs.com/DotNetNuke/archive/2008/06/08/1215913.html

总结

以上是生活随笔为你收集整理的“SQL Server does not allow remote connections”错误的解决的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。