gpt4 book ai didi

sql-server - 使用 TCP/IP 连接到 SQL Server 2008

转载 作者:行者123 更新时间:2023-12-02 09:47:38 25 4
gpt4 key购买 nike

当我尝试从 SQL Server Management Studio 使用 TCP/IP 连接时,出现以下错误。我需要一步一步的描述来解决我的问题。这里出了什么问题?

Cannot connect to 
===================================

A network related or instance specific error when a connection to SQL Server...
(provider: Named pipe-provider, error: 40 - SQL Server)
(.Net SqlClient Data Provider)

------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=53&LinkId=20476

------------------------------
Error Number: 53
Severity: 20
State: 0

------------------------------
Program Location:

at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ObjectExplorer.ValidateConnection(UIConnectionInfo ci, IServerType server)
at Microsoft.SqlServer.Management.UI.ConnectionDlg.Connector.ConnectionThreadUser()

最佳答案

我经常忘记的是,即使您在 SQLServerNetwork->MSSQLServer 协议(protocol)中将 tcp 标记为启用,您仍然需要为您的服务器启用可能不同的 IP 地址。即使只有一个 NIC 的服务器也会有多个 IP 地址。

  1. 点击上面列出的 MSSQLServer 协议(protocol)。
  2. 然后在右侧 Pane 中启用 TCP/IP。
  3. 现在双击 TCP/IP 以打开对话框窗口。
  4. 如果您想监听服务器的所有 IP 地址,请在"is"中选择"is"第一个“协议(protocol)”选项卡上的“全部监听”框;否则
  5. 选择“IP 地址”选项卡并通过设置“启用”来启用所需的 IP 地址是。

enter image description here

关于sql-server - 使用 TCP/IP 连接到 SQL Server 2008,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2388042/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com