I met today, and I solved it myself. This is what I summed up: (no matter where the post sank)
The SQL Server default database was deleted, the server could not be connected, and the user "" Login failed.
1, modify the default database for this user using the Administrator account.
Enterprise Manager, expand Server Groups, expand Servers, expand Security, click Logins, right-click the appropriate login account, and then reset the default database in properties.
When this account is the highest account, login is not possible, the security node is more unable to see.
↓↓↓↓↓↓↓↓↓↓↓↓
2. If no other administrator is logged in to the account and cannot be modified in Enterprise Manager, use the osql command-line tool:
The osql tool is a Microsoft Windows 32 command Prompt tool that you can use to run Transact-SQL statements and script files. The osql tool communicates with the server using the ODBC database application programming Interface (API).
Type cmd in Start-to-run, using "OSQL-?" command, you can display Help for the osql command line.
Note: The options list for the osql tool is case-sensitive and is noted when used.
osql/u "sa"/P "123"/d "master"/q "exec sp_defaultdb n ' sa ', n ' master '"/S "database service period name"
SQL default database deleted by mistake