简体   繁体   中英

Why can I not connect to SqlLocalDB?

I craete and start a SqlLocalDB-Instance with

C:\Program Files\Microsoft SQL Server\110\Tools\Binn\SqlLocalDB.exe c proconact -s

when I run

C:\Program Files\Microsoft SQL Server\110\Tools\Binn\SqlLocalDB.exe info proconact

I get

Name:               proconact
Version:            11.0.3000.0
Shared name:        proconact
Owner:              SUNNY-AME\sunny
Auto-create:        No
State:              Running
Last sttart time:   09.03.2017 16:40:30
Instance pipe name: np:\\.\pipe\LOCALDB#SH2D214E\tsql\query

When I try to connect with

"C:\Program Files\Microsoft SQL Server\110\Tools\Binn\Sqlcmd.exe" -S (LocalDB)\.\proconact -E

or

 "C:\Program Files\Microsoft SQL Server\110\Tools\Binn\Sqlcmd.exe" -S (LocalDB)\proconact -E

I always get the following error:

Sqlcmd: Error: Microsoft SQL Server Native Client 11.0 : Named Pipes Provider: Could not open a connection to SQL Server [2]. .
Sqlcmd: Error: Microsoft SQL Server Native Client 11.0 : Login timeout expired.
Sqlcmd: Error: Microsoft SQL Server Native Client 11.0 : 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..

I hope someone can help me, what I can do.

您需要使用:

-S "(LocalDB)\proconact" -E

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM