Unable to connect SQL Server LocalDB · Issue #305 · multiprocessio/datastation · GitHub
Skip to content

Unable to connect SQL Server LocalDB #305

Open

Description

@fortunewalla

Is there support for MS SQL Server LocalDB?

SQL Server LocalDB Instance : (localdb)\MSSQLLocalDB

So I entered the host as (localdb)\MSSQLLocalDB with pubs as the database. (This hostname works in Excel when connecting using SQL Server connection)

select 1+2;

It gives this error.

Error evaluating panel:
[INFO] 2023-08-20T22:49:28 DataStation Runner (Go) 0.11.0
[INFO] 2023-08-20T22:49:28 Evaling database panel: Untitled panel #1
[INFO] 2023-08-20T22:49:28 Failed to eval: parse "sqlserver://user:pass@(localdb)\\MSSQLLocalDB:1433?database=pubs": invalid character "\\" in host name

BTW it works with another similar software called DatabaseBrowser

image

Activity

  1. eatonphil commented on Aug 21, 2023

    @eatonphil
    Member

    Maybe try replacing (localdb)\MSSQLLocalDB with 127.0.0.1?

  2. fortunewalla commented on Aug 22, 2023

    @fortunewalla
    Author

    Maybe try replacing (localdb)\MSSQLLocalDB with 127.0.0.1?

    Thanks for trying to help out but It gives the following error.

    Error evaluating panel:
    [INFO] 2023-08-22T18:19:13 DataStation Runner (Go) 0.11.0
    [INFO] 2023-08-22T18:19:13 Evaling database panel: Untitled panel #1
    [INFO] 2023-08-22T18:19:16 Failed to eval: unable to open tcp connection with host '127.0.0.1:1433': dial tcp 127.0.0.1:1433: connectex: No connection could be made because the target machine actively refused it.
    

    This would make it use TCP connection instead of ODBC connection.

    As per the original error, it cannot parse the \ slash in the server name properly. I think? 🤔

  3. eatonphil commented on Aug 22, 2023

    @eatonphil
    Member

    DataStation just passes the connection string along to the underlying library. So you could ask this question in https://github.com/denisenkom/go-mssqldb (the library used for connecting to SQL Server) and maybe they'll know!

  4. fortunewalla commented on Aug 26, 2023

    @fortunewalla
    Author

    hopefully a resolution will be found by someone. 🤞🏼

  5. fortunewalla commented on Aug 27, 2023

    @fortunewalla
    Author

    So as per the suggestion given on this page: https://weblogs.asp.net/jongalloway/sql-force-the-protocol-tcp-named-pipes-etc-in-your-connection-string

    I tried with the connection string Server=np:(localdb)\MSSQLLocalDB

    It now gives a different error where it parses everything after : as a port number.

    Error evaluating panel:
    [INFO] 2023-08-27T16:40:05 DataStation Runner (Go) 0.11.0
    [INFO] 2023-08-27T16:40:05 Evaling database panel: Untitled panel #1
    [INFO] 2023-08-27T16:40:05 Failed to eval: parse "sqlserver://@Server=np:(localdb)\\MSSQLLocalDB?database=pubs": invalid port ":(localdb)\\MSSQLLocalDB" after host
    

    P.S. I'm posting it here also for future use by someone. 😇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions