If windows Integrated Identity Authentication is used during SQL logon, the logon box displays the logon name in the format of "machine name \ current system user name" and the logon name and password are gray, user input is not allowed.
I learned that my colleague has just modified the server's machine name, so the "new machine name \ current system user name" is displayed in the SQL login box ". You need to know that the reason why windows Integrated Identity Authentication can log on is that this user name has been included in the SQL login name. The original user name was recorded in the SQL when the SQL was installed, if the machine name is changed, "new machine name \ current system user name" cannot be properly logged on.
Someone said on the internet can use the OSQL-S instancename-E (input in the command line window) login and then modify the sa password, after some attempts found to be talking, this is because the windows Integrated Identity is required to log on.
Later, I saw a document on Microsoft's official website. I only needed to add the "-m" option in the SQL startup parameters (remember to add the "-m" option before-m ), then, restart the SQL service and use the windows Integrated Identity Authentication of SQL Management Studio to log on again.
-M indicates logon by a single user. Careful readers may question: I only added-m, but I still used windows integrated identity verification. In theory, what is the difference from using SQLOS-S instancename-E?
This question is very professional. I didn't understand it at the time, and I thought it was a bit incredible, but the result was like this, and there must be some truth. Later, I found this article on Microsoft's official website.
Start the instance of SQL Server in single-user mode by using either the-m or-f options. any member of the computer's local Administrators group can then connect to the instance of SQL Server as a member of the sysadmin fixed server role.
Generally, when the-m or-f parameter is added to the SQL startup parameters, any user in the local administrator Group of the computer can log on to the SQL as sysadmin. I believe that the reader will understand this point. In fact, it does not check whether the logged-on user exists in SQL, but whether the user is a user in the Management Group of the local computer.
Well, I believe it will not be too cumbersome in the future. I just remind the reader that after modifying the sa password, remember to delete the-m parameter originally added to the SQL startup parameter, and then restart the SQL service.