locked
Linux SQLCMD login timeout RRS feed

  • Question

  • In Linux REHL7 we installed mssql-tools and just typing sqlcmd on the command line we receive the message below. Where is it trying to login?

    I should just get a list of options. Please help.

    Thanks. 


    Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Login timeout expired.

    Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : TCP Provider: Error code 0x2AF9.

    Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.

    Tuesday, July 14, 2020 1:20 AM

All replies

  • Replace localhost with 127.0.0.1 to test.

    sqlcmd -S 127.0.0.1 -U SA

    Helpful information: install-connect-red-hatsql-server-on-linux


    Tuesday, July 14, 2020 7:28 AM
  • If you say SQLCMD without any parameters, it will attempt to connect to a default instance with Windows authentication. If you have not installed SQL Server on your Linux machine you will get this error.
    If you want a list of options try:

    sqlcmd -?


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    Tuesday, July 14, 2020 9:19 AM
  • Hi Sal Esposito,

    Is the reply helpful?

    BR,

    MIAOYUXI

    Wednesday, July 15, 2020 1:21 AM
  • Hi Sal Esposito,

    Is the issue solved?

    Is the reply helpful?

    BR,

    MIAOYUXI

    Friday, July 17, 2020 12:47 AM
  • Hi Sal Esposito,

    Any update?

    Is the reply helpful?

    BR,

    MIAOYUXI

    Tuesday, July 21, 2020 1:44 AM
  • You need connect using ip pased login.

    Login in mssql using Sqlcmd


    [root]# sqlcmd -S 10.16.1.54 -U sa
    Password:
    1> select @@version
    2> go
    Microsoft SQL Server vNext (CTP2.0) - 14.0.500.272 (X64)         Apr 13 2017 11:44:40         Copyright (C) 2017 Microsoft Corporation. All rights reserved.  Developer Edition (64-bit) on Linux (CentOS Linux 7 (Core))                                                                                            

    https://social.technet.microsoft.com/wiki/contents/articles/37872.sql-server-installation-on-centos-linux.aspx


    • Edited by AV111 Tuesday, July 21, 2020 6:33 AM link added
    Tuesday, July 21, 2020 6:31 AM