【发布时间】:2014-09-24 03:11:37
【问题描述】:
我使用名为“Projects”的 localDB 已经有一段时间了。这与默认 ASP.NET MVC 5 项目创建的数据库相同。但是,它突然停止了,我无法连接到它,也无法使用重新启动它
SqlLocalDb start Projects
我明白了
The specified LocalDB instance does not exist.
我看到文件夹在
C:\Users\[My UserName]\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\Projects
另外,我有 v11.0
C:\Users\[My UserName]\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\v11.0
我可以连接到 v11。
我还能尝试重新连接什么?
连接字符串是
<add name="DefaultConnection" connectionString="Data Source=(localdb)\Projects;Initial Catalog=master;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False" providerName="System.Data.SqlClient" />
编辑
我尝试将 Db 文件附加到连接字符串
AttachDbFileName=C:\Users\[My UserName]\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\Projects\master.mdf;
但是,我仍然无法连接
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: 50 - Local Database Runtime error occurred. The specified LocalDB instance
does not exist.)
【问题讨论】:
标签: asp.net-mvc localdb