gpt4 book ai didi

c# - IIS 8.5 SQL 错误在部署期间定位服务器 26

转载 作者:行者123 更新时间:2023-11-30 22:03:09 25 4
gpt4 key购买 nike

尝试在我的本地计算机上使用 IIS 将项目部署到网站时,出现 SQL 网络接口(interface)错误 26(下面有详细错误)。

正在尝试部署 sensenet按照他们的 guide 中的说明从 zip 文件中提取.

我一直在使用 MSDN、Stack 和 Code Project 上的在线建议解决问题,但目前还没有任何效果。

我已经禁用了 Windows 防火墙和我的第三方防火墙。我使用的端口是 8081(8080 被我的 IIS 上的一个工作网站占用),我还检查了 SQL 服务是否正在运行。还根据 this 启用了 TCP/IP方法。

我正在尝试使用 SenseNet 提供的安装 zip 中的脚本创建一个新的数据库。

我正在使用 IIS 8.5、web deploy 5 和 SQL management studio 2012。

对于可能导致此错误的原因,是否有人有任何其他建议?

谢谢

总结

The database 'SNCR' could not be created. A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)


Warning: The database 'SNCR' could not be created.
Retrying operation 'Add' on object dbFullSql (server=".C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL";database=SNCR;uid=sa). Attempt 1 of 5.

详细

Microsoft.Web.Deployment.DeploymentClientServerException: The database 'SNCR' could not be created. ---> System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover)
at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.Open()
at Microsoft.Web.Deployment.SqlServerDatabaseProvider.AddHelper(DeploymentObject source)
--- End of inner exception stack trace ---
at Microsoft.Web.Deployment.DeploymentObject.Add(DeploymentObject source, DeploymentSyncContext syncContext)
at Microsoft.Web.Deployment.DeploymentSyncContext.HandleAdd(DeploymentObject destObject, DeploymentObject sourceObject)
at Microsoft.Web.Deployment.DeploymentSyncContext.HandleUpdate(DeploymentObject destObject, DeploymentObject sourceObject)
at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildrenOrder(DeploymentObject dest, DeploymentObject source)
at Microsoft.Web.Deployment.DeploymentSyncContext.ProcessSync(DeploymentObject destinationObject, DeploymentObject sourceObject)
at Microsoft.Web.Deployment.DeploymentObject.SyncToInternal(DeploymentObject destObject, DeploymentSyncOptions syncOptions, PayloadTable payloadTable, ContentRootTable contentRootTable)
at Microsoft.Web.Deployment.DeploymentObject.SyncTo(DeploymentProviderOptions providerOptions, DeploymentBaseOptions baseOptions, DeploymentSyncOptions syncOptions)
at Microsoft.Web.Deployment.UI.InstallProgressWizardPage.OnWorkerDoWork(Object sender, DoWorkEventArgs e)
at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)

最佳答案

检查 web.config 文件:查找 SQL 连接字符串并查看在安装过程中添加的用户名和密码(不应是“sa”用户,而是像“sensenet6”这样的自定义帐户)。此用户应该有权访问也添加到连接字符串的数据库。这是一个可能有用的论坛主题:http://forum.sensenet.com/viewtopic.php?f=3&t=7279&p=10803&hilit=404&sid=c79596c733ccd9b721

关于c# - IIS 8.5 SQL 错误在部署期间定位服务器 26,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26238989/

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