Microsoft SQL Server Management StudioAdministrative Tools
Choose to use Windows authentication and click to log in, and an error will be reported, indicating that the login failed
When viewing the windows log, the reason displayed is: No login name matching the provided name could be found
There are many types of analysis in the link on the official website about the troubleshooting of error 18456, but I can’t see what the problem is.
Troubleshooting Bug 18456 – SQLBlog.org
In the end, I continued to check the information, piece together things, and found that it was
Because when I installed sqlserver, the system account I used was lyy, and an account with the login name "instance name\lyy" would be added to the sqlserver server by default during installation. Later, because I changed the system account, but the sqlserver server will not synchronize this account, so the system log shows " no login name matching the provided name found" when logging in.
If you want to log in to sqlserver, regardless of the authentication mode (windows authentication or SQL Server powder authentication), you must have a corresponding login name on the sqlserver server
Solution:
Log in using sqlserver authentication mode (remember the account password if necessary)
Security -> Logins -> (right click) New Login -> Select Users -> Select Windows Authentication
As shown in the figure below: (After adding, you can log in using Windows authentication mode)