HeidiSql connection to MS SQL Server LocalDB

后端 未结 3 1610
执念已碎
执念已碎 2021-02-03 23:04

I have been trying in vain to connect to my SQL Server database, attached to the LocalDB instance (localdb)\\v11.0, using HeidiSql and Windows Authentication.

3条回答
  •  囚心锁ツ
    2021-02-03 23:50

    It can work, but is tricky. You need to use the LocalDB named pipe as the Heidi hostname. Using LocalDB V12 for example:

    sqllocaldb info
    sqllocaldb start MSSQLLocalDB
    sqllocaldb info MSSQLLocalDB
    

    The "info" parameter reveals:

    \\.\pipe\LOCALDB#12345678\tsql\query
    

    Note the number is a random hash, which complicates things, as you need to keep checking it. It's possible to batch/script the above, with Heidi's command line options.

    My command line:

    heidisql -d=LocalDB -h=%pipename% -n=3 -d=LocalDB
    

    The -d parameter is used twice intentionally.

提交回复
热议问题