SQLSERVER2005错误提示:数据库连接失败
2010-10-22 18:29
603 查看
数据库连接
失败: 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)
错误:在Microsoft
SQL本土客户:发生错误,而建立一个到服务器的连接。 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.
当连接到SQL Server 2005中,这样的失败
可能造成的事实,即根据默认设置SQL Server不允许远程连接。
Or,
或,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.
当连接到SQL Server 2005中,这样的失败
可能造成的事实,即根据默认设置SQL Server不允许远程连接。
(provider: Named Pipes Provider, error: 40 - Could not open a
connection to SQL Server) (Microsoft SQL Server, Error: 2)
(提供者:命名管道提供商,错误: 40 -无法打开连接到S QLS erver)
( M icrosoftS QLS erver,错误: 2 )
错误原因及解决方法:
一、确保SQL Server
2005的配置是否正确,允许传入的连接上的实例数据库服务器,否则,使把对本地和远程连接设置。
Click Start button, then go to Programs or All
Programs, then select Microsoft SQL Server
2005
, followed by Configuration Tools
.
单击开始按钮,然后到程序或所有程序,然后选择了Microsoft SQL Server 2005
,其次是配置工具
。 Click
and run the SQL Server Surface Area Configuration
.
点
击和运行SQL Server表面积配置
。
On the “SQL Server
4000
2005 Surface Area
Configuration” page, click Surface Area Configuration for
Services and Connections
.
关于“ SQL Server 2005的
表面积配置”页上,单击
表面积的配置服务和连接
。
On the “Surface Area Configuration for Services
and Connections” page, expand Database Engine
tree,
click Remote Connections
.
关于“表
面积的配置服务和连接”页上,扩大数据库引擎的
树中,单击远程连接
。
Select Local and remote connections
, or Local connections only
which applicable only if
there is no remote system tries to connect to the SQL Server, useful
when you just trying to connect and authenticate with the server after
installing.
选择本地和远程连接
,或本地
连接只
,其中只适用于如果没有远程系统会尝试连接到SQL Server ,有用时,你刚才尝试连接和验
证与服务器安装完毕后。
Select the appropriate protocol to enable to
local and/or remote connections environment.
选择适当的议
定书,使本地和/或远程连接的环境。 To ensure
maximum compatibility, select Using both TCP
/IP and named
pipes
.
以确保最高的相容性,选择使用TCP / IP和命名管道
。
Click Apply
button when done.
点击应用
按钮时,做了。
Click OK
button when prompted
with the message saying that “Changes to Connection Settings will not
take effect until you restart the Database Engine service.”
单击确定
按钮时,提示讯息,他说: “更改连接设置将不会生效,直到您
重新启动数据库引擎的服务” 。
On the “Surface Area Configuration for Services
and Connections” page, expand Database Engine
, then
click Service
.
关于“表面
积的配置服务和连接”页上,扩大资料库引擎
,然后单击服务
。
Click Stop
button to stop the
SQL Server service.
点击停止
按钮来停止SQL
Server服务。
Wait until the MSSQLSERVER service stops, and
then click Start
button to restart the MSSQLSERVER
service.
等到MSSQLServer服务站,然后单击开
始
按钮,重新启动MSSQLServer服务。
二、web.config文
件中的数据库连接串中的主机IP或数据库名及服务名错误!!
将其错误修正,错误解决!!(本人遇到的是第二种情况,此情况应特别注意
)
失败: 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)
错误:在Microsoft
SQL本土客户:发生错误,而建立一个到服务器的连接。 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.
当连接到SQL Server 2005中,这样的失败
可能造成的事实,即根据默认设置SQL Server不允许远程连接。
Or,
或,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.
当连接到SQL Server 2005中,这样的失败
可能造成的事实,即根据默认设置SQL Server不允许远程连接。
(provider: Named Pipes Provider, error: 40 - Could not open a
connection to SQL Server) (Microsoft SQL Server, Error: 2)
(提供者:命名管道提供商,错误: 40 -无法打开连接到S QLS erver)
( M icrosoftS QLS erver,错误: 2 )
错误原因及解决方法:
一、确保SQL Server
2005的配置是否正确,允许传入的连接上的实例数据库服务器,否则,使把对本地和远程连接设置。
Click Start button, then go to Programs or All
Programs, then select Microsoft SQL Server
2005
, followed by Configuration Tools
.
单击开始按钮,然后到程序或所有程序,然后选择了Microsoft SQL Server 2005
,其次是配置工具
。 Click
and run the SQL Server Surface Area Configuration
.
点
击和运行SQL Server表面积配置
。
On the “SQL Server
4000
2005 Surface Area
Configuration” page, click Surface Area Configuration for
Services and Connections
.
关于“ SQL Server 2005的
表面积配置”页上,单击
表面积的配置服务和连接
。
On the “Surface Area Configuration for Services
and Connections” page, expand Database Engine
tree,
click Remote Connections
.
关于“表
面积的配置服务和连接”页上,扩大数据库引擎的
树中,单击远程连接
。
Select Local and remote connections
, or Local connections only
which applicable only if
there is no remote system tries to connect to the SQL Server, useful
when you just trying to connect and authenticate with the server after
installing.
选择本地和远程连接
,或本地
连接只
,其中只适用于如果没有远程系统会尝试连接到SQL Server ,有用时,你刚才尝试连接和验
证与服务器安装完毕后。
Select the appropriate protocol to enable to
local and/or remote connections environment.
选择适当的议
定书,使本地和/或远程连接的环境。 To ensure
maximum compatibility, select Using both TCP
/IP and named
pipes
.
以确保最高的相容性,选择使用TCP / IP和命名管道
。
Click Apply
button when done.
点击应用
按钮时,做了。
Click OK
button when prompted
with the message saying that “Changes to Connection Settings will not
take effect until you restart the Database Engine service.”
单击确定
按钮时,提示讯息,他说: “更改连接设置将不会生效,直到您
重新启动数据库引擎的服务” 。
On the “Surface Area Configuration for Services
and Connections” page, expand Database Engine
, then
click Service
.
关于“表面
积的配置服务和连接”页上,扩大资料库引擎
,然后单击服务
。
Click Stop
button to stop the
SQL Server service.
点击停止
按钮来停止SQL
Server服务。
Wait until the MSSQLSERVER service stops, and
then click Start
button to restart the MSSQLSERVER
service.
等到MSSQLServer服务站,然后单击开
始
按钮,重新启动MSSQLServer服务。
二、web.config文
件中的数据库连接串中的主机IP或数据库名及服务名错误!!
将其错误修正,错误解决!!(本人遇到的是第二种情况,此情况应特别注意
)
相关文章推荐
- oracle数据库连接时提示ora-00257错误,提示数据库归档日志归档失败
- 数据库连接失败时,如何捕捉错误,避免弹出错误提示,以便下次自动重新连接
- 连接数据库失败 错误提示:尝试读取或写入受保护的内存。这通常指示其他内存已损坏
- 连接数据库失败 错误提示:尝试读取或写入受保护的内存。这通常指示其他内存已损坏
- 用SQLServer2005还原数据库的时候出错,提示错误信息"C:/Program Files/Microsoft SQL Server/MSSQL.1/MSSQL/Data/db.mdf的目录查找失败..."。这样的错误偶尔会遇到,请问是怎么回事,该怎
- 连接数据库失败 错误提示:尝试读取或写入受保护的内存。这通常指示其他内存已损坏
- [转]VS2010连接数据库提示:提示:服务器资源管理器错误 未能找到路径“D:\Program Files\Microsoft Visual Studio 10.0VSTSDB\Microsoft.Vis
- win7 homebasic下,.net2008 连接oracle,提示错误OCIEnvCreate 失败,返回代码为 -1,但错误消息文本不可用
- 数据库连接错误:提示TCP端口1433,sql server 2008 Connection refused:connect
- sqlserver 附加数据库失败,错误提示:5拒绝访问 解决办法
- ]Sqlserver2005附加数据库时失足提示操纵体系错误5(拒绝接见)错误5120的解决办法
- 连接数据库提示错误:ORA-12505
- MFC调用4.0.1版本libpqxx库连接postgresql数据库提示编译错误
- wince 无法连接 SQL2000 数据库 提示: 常见网络错误 ,请检查您的网络文档
- Sqlserver2005附加数据库时出错提示操作系统错误5(拒绝访问)错误5120的解决办法
- VS2010添加类失败问题,弹出错误框,提示 CodeModel操作失败,无法访问标记数据库
- 数据库连接错误——请求失败或服务器未及时响应
- VS错误提示:数据库连接(一)
- SQL Server 2005 提示“到主机 的 TCP/IP 连接失败”错误