本文介绍了SQL网络接口,error:50 - 本地数据库运行时发生了错误。指定的LocalDB实例不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编辑: 一个重要的细节,我原来的离开了(因为我不知道这是重要的)是我们运行在完整的IIS这些网站,而不是从IIS防爆preSS。


我们正在努力建立本地开发环境中Kentico CMS将本地计算机添加到我们开发的当前同步链 - >分期 - >正式版(所以我们会与当地人风 - >开发 - - >分期 - >正式版)

我们复制了我们开发DB我们的本地计算机上(的LocalDB)\\ V11.0 SQL Server实例,但我们除了矿山运行到一个问题,每个人的电脑。

下面是我们得到的错误:

I've tried a ton of suggestions from other SO answers and other websites to figure out why we're getting this error (and why it's not happening on my machine), but no luck. We can connect to (localdb)\v11.0 in SSMS but we cannot connect to it through VS (same error). Also, when we open Sql Server Config Manager, we're not seeing any listings for SQL Server Services. Any ideas?

解决方案
  1. Make sure you have .NET Framework 4.0.2+ installed
  2. Set up your AppPool to run under the NetworkService account.
  3. Create a login for that account in your db.

    USE [master];CREATE LOGIN [NT AUTHORITY\NETWORK SERVICE] FROM WINDOWS;EXEC sp_addsrvrolemember N'NT AUTHORITY\NETWORK SERVICE', SYSADMIN;

  4. Share your instance with all users by runningSqlLocalDB share Kentico KenticoShared

  5. Use connection string in the following format:

<add name="CMSConnectionString" connectionString="Data Source=(localdb)\.\KenticoShared;Initial Catalog=KenticoDB;Integrated Security=True;Connect Timeout=60" />

  1. If it doesn't help use a named pipe:

<add key="CMSConnectionString" value="Persist Security Info=False;Integrated Security=SSPI;database=KenticoDB;server=np:\\.\pipe\LOCALDB#D2BA6590\tsql\query;Current Language=English;Connection Timeout=120;" />

Notes:

  1. the exact name of the NetworkService account on your machine can be determined by running following C#

var ns = new SecurityIdentifier(WellKnownSidType.NetworkServiceSid, null).Translate(typeof(NTAccount)).ToString()

  1. named pipe can be determined by running this in CMD: SqlLocalDB info KenticoShared
  2. don't forget to run your instance SqlLocalDB start KenticoShared

这篇关于SQL网络接口,error:50 - 本地数据库运行时发生了错误。指定的LocalDB实例不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 19:38