Unable to connect to LocalDB with HeidiSQL

前端 未结 2 657
走了就别回头了
走了就别回头了 2021-02-06 15:38

I have been trying to connect to a localdb instance with the latest version (at this time) of heidisql to no avail.

I have followed the instructions from this answer her

2条回答
  •  爱一瞬间的悲伤
    2021-02-06 16:03

    For the following connection string in my Web.config;

    
    

    Where the most important piece of information is Data Source=(LocalDb)\development, [replacing (of course) C:\Program Files\Microsoft SQL Server\120\ with the correct path & use the correct name chosen in your connection string after Data Source=(LocalDb)\ (noncase-sensitive, development in my case)] try:

    "C:\Program Files\Microsoft SQL Server\120\Tools\Binn\SqlLocalDB.exe" info Development
    

    This should output something similar to:

    Name:               Development
    Version:            12.0.2000.8
    Shared name:
    Owner:              hostname\username
    Auto-create:        No
    State:              Running
    Last start time:    8/2/2016 3:20:57 PM
    Instance pipe name: np:\\.\pipe\LOCALDB#CDE5547F\tsql\query
    

    Copy \\.\pipe\LOCALDB#CDE5547F\tsql\query from the "Instance pipe name", WITHOUT the initial np:. Also, your pipe name is likely to be different than mine.

    Then you can create a new session in HeidiSQL like this:

    N.B.: "Network type", "Hostname / IP", and "Use Windows authentication" are important; whilst other settings (such as "Databases") is up to you, so you could leave them empty / skip, etc.

    Credits go to https://stackoverflow.com/a/33748584/11895 for the pipe name suggestion.

提交回复
热议问题