Today, I found that the SQL2000 server I maintain has an error. Some time ago, I told another colleague about the server password. He installed a system on it and didn't know how to do it. Now, the Enterprise Manager cannot be connected. The original SA password is not set by me. He said that SQL2000 has not been moved, which is really troublesome.
The solution I found is as follows, but it seems that it is not feasible for my machine.
"Unable to connect to the server, user XXX Login Failed"
This error occurs because SQL server uses the "Windows only" authentication method,
Therefore, you cannot connect to the SQL Server login account (such as SA). The solution is as follows:
1. Use the enterprise manager on the server side and select "use Windows Authentication" to connect to SQL Server
2. Expand "SQL Server group", right-click the name of the SQL Server server, select "properties", and then select the "Security" tab.
3. Under "authentication", select "SQL Server and Windows ".
4. Restart the SQL Server service.
In the preceding solution, if you fail to connect to SQL server by using "use Windows Authentication" in step 1,
Modify the Registry to solve this problem:
1. Click "start" "Run", enter regedit, and press enter to enter the Registry Editor.
2. Expand the registry key in sequence and browse to the following registry key:
[HKEY_LOCAL_MACHINE/software/Microsoft/MSSQLServer]
3. Find the name "loginmode" on the right of the screen and double-click to edit the double-byte value.
4. Change the original value from 1 to 2 and click "OK"
5. Disable Registry Editor
6. Restart the SQL Server service.
In this case, you can successfully use SA to create an SQL Server registration in the Enterprise Manager,
However, you still cannot connect to SQL Server in Windows Authentication mode.
This is because there are two default logon accounts in SQL Server:
Builtin/administrators
<Machine Name>/Administrator deleted.
To restore these two accounts, you can use the following methods:
1. Open the Enterprise Manager, expand the server group, and then expand the server
2. Expand security, right-click logon, and click New logon"
3. In the Name box, enter builtin/administrators
4. On the "server role" tab, select "System Administrators"
5. Click "OK" to exit
6. Use the same method to add <machine Name>/administrator to log on.
Note:
The following registry key:
HKEY_LOCAL_MACHINE/software/Microsoft/MSSQLServer/loginmode
The value determines the Authentication mode that SQL server will adopt.
1. indicates that the "Windows Authentication" mode is used.
2. indicates that the hybrid mode is used (Windows Authentication and SQL Server Authentication ).
I am dealing with this problem as follows:
1. re-register the SQL Server and enter the server name: localhost. At this time, the system can re-connect to the SQL database.
2. Enable Security under localhost-> log on and change the SA password.
3. Edit the default local service connection attribute and change it to the correct SA password.
In this way, the local connection can be correctly started.
You can also delete the localhost connection.
However, there is a legacy problem, that is, the Windows Authentication mode is still unsuccessful and I don't know why. I follow the instructions above to delete and recreate both builtin/administrators and administrator. Strange ~~