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 here but it doesn't seem to work (anymore):
HeidiSql connection to MS SQL Server LocalDB
I tried the following:
heidisql -d=LocalDB -h=%pipename% -n=3 -d=LocalDB
heidisql -d=LocalDB -h= np:.\pipe\LOCALDB#41CF9FCB\tsql\query -n=3 -d=LocalDB (i realize that the number changes every time your start a new localdb instance)
heidisql -d=LocalDB -h=41CF9FCB -n=3 -d=LocalDB
Any ideas?
EDIT
3条答案
按热度按时间ljsrvy3e1#
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 afterData Source=(LocalDb)\
(noncase-sensitive,development
in my case)] try:This should output something similar to:
Copy
\\.\pipe\LOCALDB#CDE5547F\tsql\query
from the "Instance pipe name", WITHOUT the initialnp:
. 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.
bd1hkmkf2#
As of heidisql.exe Revision 9.3.0.5108 you could also:
"C:\Program Files\Microsoft SQL Server\120\Tools\Binn\SqlLocalDB.exe" start "MSSQLLocalDB"
"C:\Program Files\Microsoft SQL Server\120\Tools\Binn\SqlLocalDB.exe" info "MSSQLLocalDB"
(e.g.,\\.\pipe\LOCALDB#1B9DCF1E\tsql\query
"C:\Program Files\HeidiSQL\heidisql.exe --nettype=3 --host="\\.\pipe\LOCALDB#1B9DCF1E\tsql\query" --winauth=1"
I use a Bash script that automates all that, and it goes roughly like this:
rwqw0loc3#
Here is an AutoHotkey script that automates everything, from copying DB instance name to opening, pasting and connecting to the server.
(Adjust Sleep if it's too fast)