gpt4 book ai didi

sql-server - SQL 错误 : Verify that the instance name is correct and that SQL Server is configured to allow remote connections?

转载 作者:行者123 更新时间:2023-12-05 04:19:01 24 4
gpt4 key购买 nike

我在连接到我的本地 Sql Express 时遇到以下错误:

An error has occurred. Details of the exception:
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)
Unable to connect to SQL Server database.

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

我正在使用 aspnet_regiis 通过以下命令生成 session 状态数据库。

aspnet_regsql.exe -ssadd -sstype c -d App_SessionState -S [.\SQLEXPRESS] -U [USERiD] -P [Password]

最佳答案

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

要在 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.

关于sql-server - SQL 错误 : Verify that the instance name is correct and that SQL Server is configured to allow remote connections?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3142393/

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