Login to Microsoft SQL Server Error: 18456

前端 未结 21 2054
醉话见心
醉话见心 2020-11-27 10:11

I am getting this error while trying to connect to the SQL Server.

Microsoft SQL Server Error: 18456

Can anybody tell me what th

21条回答
  •  忘掉有多难
    2020-11-27 10:54

    SQL Server connection troubleshoot

    In case you are not able to connect with SQL Authentication and you've tried the other solutions.

    You may try the following:

    Check connectivity

    • Disable Firewall.
    • Run PortQry on 1434 and check the answer.

    Check the state

    • Try to connect with SSMS or sqlcmd and check the message.
    • State 1 is rarely documented but it just mean you don't have the right to know the true state.
    • Look at the log file in the directory of SQL server to know what is the state.

    The State 5

    What ? my login doesn't exist ? it's right there, I can see it in SSMS. How can it be ?

    The most likely explanation is the most likely to be the right one.

    The state of the login

    • Destroy, recreate it, enable it.
    • reset the password.

    Or...

    "You don't look at the right place" or "what you see is not what you think".

    The Local DB and SQLEXPRESS conflict

    If you connect with SSMS with Windows authentication, and your instance is named SQLEXPRESS, you are probably looking at the LocalDb and not the right server. So you just created your login on LocalDb.

    When you connect through SQL Server authentication with SSMS, it will try to connect to SQLEXPRESS real server where your beloved login doesn't exist yet.

    Additional note: Check in the connection parameters tab if you've not forgotten some strange connection string there.

提交回复
热议问题