SQL server connectivity issue TCP Provider: Error code 0x2746.

Kaif Khan 0 Reputation points
2024-10-30T06:08:11.33+00:00

I am trying to connect to sqlserver using sqlcmd command line tool, but its failing.
Error logs on server side:
Date Source Message 10/29/2024 3:43:08 PM Logon Length specified in network packet payload did not match number of bytes read; the connection has been closed. Please contact the vendor of the client library. [CLIENT: 48.216.198.190] 10/29/2024 3:43:08 PM Logon Error: 17836, Severity: 20, State: 17.

From client side
sqlcmd -S 3.14.36.201 -U svc_lightbeam_temp -P <> -d master`` ``Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : TCP Provider: Error code 0x2746.`` ``Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Client unable to establish connection.

SQL server details
Microsoft SQL Server 2016 (SP1-CU8) (KB4077064) - 13.0.4474.0 (X64)  Feb 24 2018 13:53:17  Copyright (c) Microsoft Corporation Web Edition (64-bit) on Windows Server 2012 R2 Standard 6.3 <X64> (Build 9600: ) (Hypervisor)

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,971 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ZoeHui-MSFT 37,441 Reputation points
    2024-10-30T06:23:50.0233333+00:00

    Hi @Kaif Khan,

    Please first check is that TCP/IP is enabled in Sql Server Configuration Manager.

    For more details, you need check errorlog. By default, the error log is located at Program Files\Microsoft SQL Server\MSSQL.n\MSSQL\LOG\ERRORLOG and ERRORLOG.n files.

    In additon, you can check the system logs for any additional error messages or warnings that may provide further insight into the cause of the issue.

    Finally, verify that there are no network connectivity issues between the client machine and the SQL Server instance. This can include checking for firewalls, routers, or other network devices that may be blocking traffic.

    Regards,

    Zoe Hui


    If the answer is helpful, please click "Accept Answer" and upvote it.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.