sql-server - SQL 错误 : Verify that the instance nam

我在连接到我的本地 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/

相关文章:

git - 如何使用 ssh 将 repo 克隆到远程服务器

asp.net-mvc - ASP.Net MVC 2.0 : unescaping URL que

ruby-on-rails - rails : Expected helper to define

python - python 中的 Rfc 1123

open-source - 用于检测运行笔迹的开源

sql - 对于每个唯一的 A 列,什么 SQL 查询返回具有最新日期和时间(B 列和 C 列)的行

orm - Eclipselink - 坚持后的ID仍然为空

apache - 在 ReverseProxy 上下文中切换 SSLVerifyClient

ejabberd - 如何阻止 ejabberd 使用 mnesia

c# - 以特定时间间隔从视频(mpg、wmv 等)中捕获帧