SQL错误:验证实例名称是否正确并且SQL Server是否配置为允许远程连接?

问题描述 投票:2回答:1

连接到本地Sql Express时出现以下错误:

发生了错误。例外细节: 建立与SQL Server的连接时发生与网络相关或特定于实例的错误。服务器未找到或无法访问。验证实例名称是否正确,以及SQL Server是否配置为允许远程连接。 (提供程序:SQL网络接口,错误:26 - 查找指定的服务器/实例时出错) 无法连接到SQL Server数据库。

我可以使用Management Studio连接到Sql Server。

我使用aspnet_regiis使用以下命令生成会话状态数据库。

aspnet_regsql.exe -ssadd -sstype c -d App_SessionState -S [.\SQLEXPRESS] -U [USERiD] -P [Password]
sql-server sql-server-2005 networking
1个回答
1
投票

您的数据库是Windows还是混合模式身份验证?要使用用户标识和密码登录,服务器需要处于混合模式身份验证。

要在Management Studio中进行检查:

 1. Right click the server name in the Object Explorer tree on the left and select Properties.
 2. Click Security.
 3. Under Server authentication select SQl Server and Windows Authentication Mode.
 4. Click OK
 5. You need to restart SQL Server, so right click the server name again and select Restart.
© www.soinside.com 2019 - 2024. All rights reserved.