Symptoms
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.
Resolution
This problem is fixed in the following cumulative updates for SQL Server:
Each new cumulative update for SQL Server contains all the hotfixes and security fixes that were in the previous build. We recommend that you install the latest build for your version of SQL Server:
Status
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
More information
This issue occurs when you try to connect to a shared instance of LocalDB.
REM Create named instance FOO
SqlLocalDB.exe create FOO
REM Run the following command from an elevated command prompt
REM Share instance FOO as FOOSHARED
SqlLocalDB.exe share FOO FOOSHARED
When you run the following command, you may receive an error message as shown below:
SqlCmd.exe -S (localdb)\.\FOOSHARED -E
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..
References
Learn about the terminology that Microsoft uses to describe software updates.