2

I installed the LocalDB component (only) from SQL Server 2019 Express on a Windows 10 machine that had NO Sql Server installation of any kind. I installed SSMS next.

The AUTOMATIC instance MSSQLLOCALDB works as advertised. I can use SSMS to access it, add a database, perform queries, everything is fine.

I want to make this instance shared.

So I typed (from Powershell) sqllocaldb share MSSQLLOCALDB SharedDb

The shared instance is properly created.

PS C:\WINDOWS\system32> sqllocaldb i
.\SharedDb

MSSQLLocalDB

But I cannot access the shared instance from SSMS

Things I have tried

  • Stopped and started the automatic instance
  • used the servername as (localdb)\.\SharedDb as documented.
  • tried it from sqlcmd where it works for the automatic instance, but fails for the shared instance.
  • rebooted the machine

Fails with: Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Named Pipes Provider: Could not open a connection to SQL Server [2]. . Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Login timeout expired. Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..

Any suggestions on how to share a LocalDB instance would be appreciated. Thanks.

Shripathi Kamath
  • 310
  • 3
  • 10
  • Does this answer your question? [How to share SQL LocalDb with other users on same machine?](https://stackoverflow.com/questions/15915521/how-to-share-sql-localdb-with-other-users-on-same-machine) – SMor Aug 15 '20 at 02:54
  • No. That answer suggests one move to SQL Server Express, which is not an option for me. – Shripathi Kamath Aug 15 '20 at 20:49
  • Read the entire thread - not just the one marked as answered. The highest voted answer shows the correct command to share the instance. But the marked answer is something you should seriously consider. localdb is intended to be "local" - specific to a single process. – SMor Aug 18 '20 at 15:17
  • I did, thank you. I understand the complications of needing a dedicated user, my issue is that the documented way of creating a shared instance does not work. So, either I am doing something wrong, or there is another way. – Shripathi Kamath Aug 19 '20 at 05:11

1 Answers1

2

There is a known bug in SQL Server Version 2017 and newer that breaks the use of Shared Instance. Currently the only Option is to downgrade to SQL Server Version 2016.

Please Upvote this Issues on the SQl Feedback Forum, hopfuly they will fix it eventually.

For an detailed explanation of the problem view the answer on this Post

J. Selchow
  • 66
  • 8