patternMinor
Can't connect to SQL Server 2017 Local DB shared instance
Viewed 0 times
localcanconnectsharedsqlinstanceserver2017
Problem
I cannot connect to a SQL Server 2017 (14.0.1000.169) Local DB shared instance.
I tried on a laptop that previously had some SQL Server Express and stuff that I all have uninstalled. And also on a fresh Win10 VM.
Both always have the same error:
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Named Pipes Provider: Could not open a connection to SQL Server 2. .
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 17 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..
This error is from
I tried connecting with the owner of the instance and could not. Also tried with a SQL Login with sysadmin right and could not.
I can only connect with the pipe name.
I also tried everything from:
Why can't I connect?
I tried on a laptop that previously had some SQL Server Express and stuff that I all have uninstalled. And also on a fresh Win10 VM.
Both always have the same error:
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Named Pipes Provider: Could not open a connection to SQL Server 2. .
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 17 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..
This error is from
SQLCMD but I've also tried with SSMS and Visual Studio connection string.I tried connecting with the owner of the instance and could not. Also tried with a SQL Login with sysadmin right and could not.
I can only connect with the pipe name.
I also tried everything from:
- Why can't I connect to a SQL Server 2012 LocalDB shared instance? on Stack Overflow
- SQL 2016 sp1 SQLLocalDB versions errors with "Windows API call "RegGetValueW" returned error code: 0." on MSDN Forums
Why can't I connect?
Solution
This issue is resolved by:
KB5003342 - FIX: SQL Server Express LocalDB can't start or connect to shared instances of SQL Server Express LocalDB 2019 or 2017
Assume that you use the SqlLocalDB feature in Microsoft SQL Server 2019 or 2017. In this situation, you can't start correctly or connect to a shared instance of SqlLocalDB.
This problem is fixed in the following cumulative updates for SQL Server:
-
Cumulative Update 11 for SQL Server 2019
-
Cumulative Update 24 for SQL Server 2017
Demo:
KB5003342 - FIX: SQL Server Express LocalDB can't start or connect to shared instances of SQL Server Express LocalDB 2019 or 2017
Assume that you use the SqlLocalDB feature in Microsoft SQL Server 2019 or 2017. In this situation, you can't start correctly or connect to a shared instance of SqlLocalDB.
This problem is fixed in the following cumulative updates for SQL Server:
-
Cumulative Update 11 for SQL Server 2019
-
Cumulative Update 24 for SQL Server 2017
Demo:
Context
StackExchange Database Administrators Q#249097, answer score: 4
Revisions (0)
No revisions yet.