Tuesday 24 May 2016

LinWin - Heidisql Navicat connectivity with Microsofts' Sql server LocalDB

In this post I will show how to retrieve connection string for LocalDB to use with Database admin tools

Navicat to  LocalDB Connectivity
Heidisql  to  LocalDB Connectivity

locate SqlLocalDB.exe in win 10 64 bit its located at \Program Files\Microsoft SQL Server\120\Tools\Binn


Start cmd (open command prompt)
Navigate to ->  cd \Program Files\Microsoft SQL Server\120\Tools\Binn

If you want to create new DB then run

> SqlLocalDB create "localsql"  -- here localsql is the name for new instance

After creating DB you need to start it

> SqlLocalDB start "localsql"  -- here localsql is the name for instance which needed to be started

To get the connection string for Navicat or Heidisql

> SqlLocalDB info "localsql"

C:\Program Files\Microsoft SQL Server\120\Tools\Binn>SqlLocalDB info "localsql"
Name:               localsql
Version:            12.0.2000.8
Shared name:
Owner:              Home\DELL
Auto-create:        No
State:              Running
Last start time:    24-05-2016 01:03:05 PM
Instance pipe name: np:\\.\pipe\LOCALDB#03AD832F\tsql\query

we need to put
Instance pipe name: np:\\.\pipe\LOCALDB#03AD832F\tsql\query
to hostname in navicat or Heidisql



Enjoy :)

3 comments:

  1. I Am Using Visual Studio Inbuilt Server LocalDB
    this is my connection string in webapp
    Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\CTS.mdf;Integrated Security=True

    I tried Using your method but i am getting error hedisql plz rply how to do this
    help appreciated plz check screenshot of my pc

    https://postimg.org/image/9rowdhnqp/

    ReplyDelete
    Replies
    1. Hi Patrik,

      Check the firewall too , In screenshot its look ok you also try with navicat (free trial available) and see if this happen with it too, if yes then might be firewall issue.

      Regards

      Delete