SQL 2008 R2 error 18456 (Login Failed for User )

Rubin, Avi 1 Reputation point
2021-02-28T17:45:12.683+00:00

Hi all,

i'm using C# code to read from DB using sql 2008 R2.

sometimes the connection is valid and for random time it seems that the connection is failed, although the username and password didn't changed.

I try to install again but no luck.

i have 3 of the same computers, with the same windows version and HW and it happened only in one computer.

what should I do to get to the root of this? it is clear that is not username\password error.

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

3 answers

Sort by: Most helpful
  1. Yitzhak Khabinsky 25,106 Reputation points
    2021-02-28T18:07:54.57+00:00

    Hi @Rubin, Avi ,

    What driver/provider you are using?
    Please edit your post and add a source code for connectivity to a DB.

    You can always use a *.udl file to troubleshoot the connectivity.

    72706-udl.png

    72700-udl-v2.jpg

    0 comments No comments

  2. Erland Sommarskog 101.4K Reputation points MVP
    2021-02-28T19:02:14.49+00:00

    Check in the SQL Server errorlog for messages relating to these login failures. In later error versions of SQL Server there is an actual error message, but it may be that in SQL 2008 R2, there is only the state., but you can use this page to get reason and an explanation that particular state.

    For further assistance, it helps to know

    1. if the applications are running on a the same machine as SQL Server or a different machine.
    2. Whether you are using Windows or SQL authentication.
    3. Whether you are in a domain or in a workgroup.
    0 comments No comments

  3. CathyJi-MSFT 21,096 Reputation points Microsoft Vendor
    2021-03-01T03:03:11.563+00:00

    Hi @Rubin, Avi ,

    Please share us the information that others mentioned above. We need more message about the error 18456 for analysis. Connenction error 18456 is a genaral connection error message.

    In addition, whether your network is stable , due to the issue is occurred randomly? SQL server 2008 R2 is too old , it is out of support for a long time. What is version of your SQL server ? Did you apply the SP3 for SQL server 2008 R2?


    If the response is helpful, please click "Accept Answer" and upvote it, thank you.

    0 comments No comments