本文介绍了从Visual Studio 2013而非SQL Server Management Studio调用时SQL LocalDb自动实例启动失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每个MSDN文档: http://msdn.microsoft.com/zh-我们/library/hh510202.aspx

LocalDB支持两种实例:自动实例和命名实例.

我怀疑这与我的问题有关,所以我想知道是否有人知道如何自动创建这样的东西.如果我能引用这些文档,则用户计算机上安装的每个版本的LocalDB都存在一个LocalDB的自动实例."

I suspect this has something to do with my problem, so I am wondering if anyone knows how something like this gets automatically created. If I can quote from the docs, "One automatic instance of LocalDB exists for every version of LocalDB installed on the user’s computer."

以下是上述链接中相关部分的副本:

Here is a copy of the relevant section in the above link:

不同版本的LocalDB将具有不同的实例命名约定:

Different versions of LocalDB will have different instance naming conventions:

SQL 2012 LocalDB = V11.0
SQL 2014 LocalDB = ProjectsV12

  • 我见过其他人.
  • 只要正在连接的应用程序的连接字符串指向正确的实例,一切都很好:

    As long as the connecting app's connection string points to the correct instance, all is well:

    (localdb)\V11.0
    (localdb)\ProjectsV12
    

    如果我尝试使用SQL Server Management Studio连接到实例(localdb)\ V11.0或(localdb)\ ProjectsV12,则我可以,已停止"的服务器自动启动" .

    If I try to connect with SQL Server Management Studio to either instance (localdb)\V11.0 or (localdb)\ProjectsV12, I CAN, the "stopped" server "autostarts".

    如果我将VS2013中的SQL Server实例设置为实例(localdb)\ V11.0或(localdb)\ ProjectsV12,则我无法,停止"的服务器无法启动".它会尝试启动,但会失败.

    If I set the SQL Server instance in VS2013 to either instance (localdb)\V11.0 or (localdb)\ProjectsV12, I CANNOT, the "stopped" server "fails" to start. It attempts to start, but fails.

    这是在实例error.log中找到的错误消息,指示了实例启动失败的原因.

    Here is the error message found in the instance error.log indicating why the instance start failed.

    014-12-19 15:12:14.09 Logon       Error: 17828, Severity: 20, State: 3.
    2014-12-19 15:12:14.09 Logon      The prelogin packet used to open the connection is structurally invalid; the connection has been closed. Please contact the vendor of the client library. [CLIENT: <named pipe>]
    

    我可能在这里找到了线索:

    I may have found a clue here:

    在我的其中一台自动实例化的机器上,sqllocaldb命令输出以下内容:

    On one of my machines where Automatic Instancing works, the sqllocaldb command outputs following:

    C:\>sqllocaldb info v11.0
    Name:               v11.0
    Version:            11.0.3000.0
    Shared name:
    Owner:              AM\Z617699
    Auto-create:        Yes            <-- Yes? - and I have no idea how this is set.
    State:              Stopped
    Last start time:    12/18/2014 5:18:46 PM
    Instance pipe name:
    

    在我的其他机器之一上,自动实例化不起作用,sqllocaldb命令输出以下内容:

    On one of my other machines where Automatic Instancing does NOT work, the sqllocaldb command outputs following:

    C:\>sqllocaldb info v11.0
    Name:               v11.0
    Version:            11.0.3000.0
    Shared name:
    Owner:              AM\Z617699
    Auto-create:        No              <-- No? - and I have no idea how this is set.
    State:              Stopped
    Last start time:    12/18/2014 5:18:46 PM
    Instance pipe name:
    

    我花了几天的时间来寻找这个问题的答案.这是MSDN论坛帖子的链接,该帖子概述了我为解决此问题而采取的所有不成功的步骤: https://social.msdn.microsoft.com/Forums/sqlserver/zh-CN/83ad45d5-15c3-4463-bc0c -6c4899bf947e/localdb-visual-studio-2013-will-not-automatically-start-the-sql-2014-localdb-projectsv12-instance?forum = sqlexpress

    I have spent days trying to find the answer to this question. Here is a link to an MSDN forum post that outlines all the unsuccessful steps I have taken to resolve this issue:https://social.msdn.microsoft.com/Forums/sqlserver/en-US/83ad45d5-15c3-4463-bc0c-6c4899bf947e/localdb-visual-studio-2013-will-not-automatically-start-the-sql-2014-localdb-projectsv12-instance?forum=sqlexpress

    解决方法是在启动VS2013之前手动启动实例.我只是想解决此问题,以便为所有开发人员提供一个自动实例"图像.

    The workaround is to just start the instance manually before you start VS2013. I'm just trying to resolve this issue so I can get an "Automatic Instance" image for all our developers.

    希望您知道他的回答. :-)

    I hope you just know he answer. :-)

    谢谢,戴夫

    推荐答案

    我遇到了同样的问题.我通过从命令行删除并重新创建实例来解决它:

    I had the same issue.I resolved it by deleting and recreating the instance from command line:

    1. 打开命令行
    2. 通过键入以下内容删除会话:sqllocaldb delete"v11.0"
    3. 使用以下方法重新创建实例:sqllocaldb create"v11.0"

    新实例允许自动创建并解决问题.

    The new instance allows auto creation, and solves the issue.

    解决方案来自: http://answers.flyppdevportal.com/categories/sqlserver/sqlexpress.aspx?ID = 8bcb5f1e-0240-4df3-8a5e-7e3e73e1c45b

    这篇关于从Visual Studio 2013而非SQL Server Management Studio调用时SQL LocalDb自动实例启动失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-21 08:33