SQL 无法启动 LocalDB

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13287252/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 12:01:11  来源:igfitidea点击:

Cannot start LocalDB

sqlsql-serversql-server-2012

提问by Pogrindis

Cannot start LocalDB instance, I have installed and re-installed over and over.

无法启动 LocalDB 实例,我一遍又一遍地安装和重新安装。

Keep getting this error :

不断收到此错误:

Start of LocalDB instance "v11.0" failed because of the following error: Error occurred during LocalDB instance startup: SQL Server process failed to start.

由于以下错误,LocalDB 实例“v11.0”的启动失败:LocalDB 实例启动期间发生错误:SQL Server 进程无法启动。

Anyone any advice ? ?

有人有什么建议吗??

Microsoft SQL Server 2012, i have ensured the FULL installation options, stopped all services SQL related and tried restarting .

Microsoft SQL Server 2012,我确保了完整的安装选项,停止了所有与 SQL 相关的服务并尝试重新启动。

sqllocal info 

gives me :

给我 :

Projects v11.0

项目 v11.0

when i try

当我尝试

sqllocal start v11.0

I get the above error.

我收到上述错误。

回答by Tim Lovell-Smith

When all else fails and you don't care about data loss, delete and recreate your LocalDB\v11.0 database! At the command prompt

当所有其他方法都失败并且您不关心数据丢失时,请删除并重新创建您的 LocalDB\v11.0 数据库!在命令提示符下

sqllocaldb delete v11.0
sqllocaldb create v11.0

(Sqllocaldb is in your PATH right? It was for me.)

(Sqllocaldb 在您的 PATH 中,对吗?它是给我的。)

回答by Alex

I was getting a similar error, but when running

我遇到了类似的错误,但是在运行时

sqllocaldb start

The local db started successfully. Also when checking the event log I saw an error along the lines of

本地数据库启动成功。此外,在检查事件日志时,我看到了一个错误

Windows API call WaitForMultipleObjects returned error code: 575

Windows API 调用 WaitForMultipleObjects 返回错误代码:575

What fixed it for me:

什么为我修好了:

  1. In IIS, configure the app pool to run under an account with permissions to the DB on the server (advanced options of the app pool)
  2. In the advanced option of the app pool, set Load User Profileto true
  1. 在 IIS 中,将应用程序池配置为在对服务器上的 DB 具有权限的帐户下运行(应用程序池的高级选项)
  2. 在应用程序池的高级选项中,将Load User Profile设置为true

Reference: http://blogs.msdn.com/b/sqlexpress/archive/2011/12/09/using-localdb-with-full-iis-part-1-user-profile.aspx

参考:http: //blogs.msdn.com/b/sqlexpress/archive/2011/12/09/using-localdb-with-full-iis-part-1-user-profile.aspx

回答by user3285954

It worths looking at LocalDB log files too, it is more detailed than event log:

也值得查看 LocalDB 日志文件,它比事件日志更详细:

%LocalAppData%\Microsoft\Microsoft SQL Server Local DB\Instances\ProjectsV12\error.log

Besides recreating the instance I had to delete the content of this folder:

除了重新创建实例外,我还必须删除此文件夹的内容:

%LocalAppData%\Microsoft\VisualStudio\SSDT\

This is where I have the mdf and ldf files.

这是我拥有 mdf 和 ldf 文件的地方。

回答by Dan Rubio

My solution:

我的解决方案:

Go to: %LocalAppData%\Microsoft\Microsoft SQL Server Local DB\and allow total control of the folder "Instances" to everyonegroup.

转到: %LocalAppData%\Microsoft\Microsoft SQL Server Local DB\并允许对文件夹“Instances”进行everyone分组的完全控制。

I know this is not OK but it solved my problem and i don't really care about the data of that folder as this is a developing and testing computer.

我知道这不好,但它解决了我的问题,我并不真正关心该文件夹的数据,因为这是一台正在开发和测试的计算机。

回答by Mike Veazie - MSFT

Same problem here. Here's how I fixed it using bits of the other solutions posted here.

同样的问题在这里。这是我使用此处发布的其他解决方案的位修复它的方法。

I had dozens of these errors in the application event log:

我在应用程序事件日志中有很多这样的错误:

Windows API call WaitForMultipleObjects returned error code: 575. Windows system error message is: {Application Error}
The application was unable to start correctly (0x%lx). Click OK to close the application.
Reported at line: 3730. 

I realized that I had SQL Server Management Studio installed on my development machine, but no other SQL components. I installed the database engine, shared components, and localdb from SQL Express

我意识到我的开发机器上安装了 SQL Server Management Studio,但没有安装其他 SQL 组件。我从 SQL Express 安装了数据库引擎、共享组件和 localdb

https://www.microsoft.com/en-us/cloud-platform/sql-server-editions-express

https://www.microsoft.com/en-us/cloud-platform/sql-server-editions-express

After installing, I still get the same error in event log :(

安装后,我仍然在事件日志中收到相同的错误:(

Found this article: Cannot start LocalDB

找到这篇文章: 无法启动LocalDB

Run the following in cmd to get the localdb instance name: C:> sqllocaldb info

在 cmd 中运行以下命令以获取 localdb 实例名称:C:> sqllocaldb info

In my install, I had: MSSQLLocalDB ProjectsV13

在我的安装中,我有: MSSQLLocalDB ProjectsV13

I ran the following to delete the instances:

我运行以下命令来删除实例:

sqllocaldb delete MSSQLLocalDB
sqllocaldb delete ProjectsV13

I ran into issues trying to delete/create these (sqllocaldb delete MSSQLLocalDB). I ended up deleting all of the folders and files under '%LocalAppData%\Microsoft\Microsoft SQL Server Local DB\Instances*' (You need to stop SQL Server and kill all sqlserver processes)

我在尝试删除/创建这些时遇到了问题(sqllocaldb delete MSSQLLocalDB)。我最终删除了“%LocalAppData%\Microsoft\Microsoft SQL Server Local DB\Instances*”下的所有文件夹和文件(您需要停止 SQL Server 并终止所有 sqlserver 进程)

Then running 'sqllocaldb create' created and started the default instance and all files.

然后运行 ​​'sqllocaldb create' 创建并启动默认实例和所有文件。

回答by doctaj

I had this issue. I was trying to use Windows Authentication through an application, but the IIS App Pool credentials were wrong. I was using my Windows user name (ie: NETWORK\name) as my identity, but I changed it to the built-in "LocalSystem" and it worked.

我有这个问题。我试图通过应用程序使用 Windows 身份验证,但 IIS 应用程序池凭据错误。我使用我的 Windows 用户名(即:)NETWORK\name作为我的身份,但我将其更改为内置的“ LocalSystem”并且它起作用了。

回答by john blair

What worked for me was the local IIS application pool I was using was the ApplicationPoolIdentity and that did not have permission to login to MSSQLLocalDB. As soon as a I changed the app pool identity to my windows login account - I was able to connect ok.

对我有用的是我使用的本地 IIS 应用程序池是 ApplicationPoolIdentity,它没有登录到 MSSQLLocalDB 的权限。一旦我将应用程序池标识更改为我的 Windows 登录帐户 - 我就可以正常连接。

回答by SchmitzIT

You should check the Event Log for additional information.

您应该检查事件日志以获取更多信息。

Product Name
SQL Server

Product Version11.0

Product Build Number

Event ID
266

Event Source
SQL Server Local Database Runtime 11.0

Component
Local Database Runtime API

Message Text
Error occurred during Local Database instance startup: SQL Server process failed to start.

ExplanationA SQL Server process is started but SQL Server startup failed.

User ActionSee the event log for details.

产品名称
SQL Server

产品版本11.0

产品版本号

事件 ID
266

事件源
SQL Server 本地数据库运行时 11.0

组件
本地数据库运行时 API

消息文本
本地数据库实例启动期间发生错误:SQL Server 进程启动失败。

说明SQL Server 进程已启动,但 SQL Server 启动失败。

用户操作有关详细信息,请参阅事件日志。

Source: http://msdn.microsoft.com/en-us/library/hh256140.aspx

来源:http: //msdn.microsoft.com/en-us/library/hh256140.aspx