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

Sanjeev Gupta 51 Reputation points
2021-09-15T07:09:20.237+00:00

Hi,

I have installed SQL Server 2019 on Linux platform and had done all the necessary steps and I was able to login to SQL Server via sqlcmd some time ago but suddenly I have started seeing below error when connecting to SQL Server via sqlcmd. i have verified for port as well and its open. please help me to fix this issue.

[rootanonymous user ~]# sqlcmd -Slocalhost -Usa -PXXXXX
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 0x2749.
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..

[rootanonymous user ~]# firewall-cmd --list-ports
1433/tcp

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,031 questions
{count} votes

6 answers

Sort by: Most helpful
  1. Gabriel Paniagua 0 Reputation points
    2024-03-14T19:32:36.2066667+00:00

    Hi! , I hope you were able to solve this problem before this comment. I had the same issue and I solved it this way:

    1_ sudo Docker ps -a

    I realized that my containers did not have a port configured. So

    2_ Do a new pull.

    0 comments No comments