SQL Server Common error (1) "Unable to open user default database, Logon Failed" (2) failed to start SQL Server after system password changed

Source: Internet
Author: User
Tags command line
server|sqlserver| Error | data | database

Unable to open the user default database , logon failed, which is one of the problems that SQL Server users are familiar with. When using Enterprise Manager, Query Analyzer, various kinds of tools and application software, as long as the connection to the SQL Server database, it is possible to encounter this problem, causing this error occurred more than the reason, let us analyze the cause of the problem and the solution.

First, why
The default database for the login account is deleted.

Second, the solution:
(a), using the Administrator account to modify the default database for this account
1, open Enterprise Manager, expand the server group, and then expand the server
2. Expand "Security", expand Login, right-click the corresponding login account, select from the pop-up menu, properties
3. Re-select the default database for this login account
(b), if there is no other administrator login account, can not be modified in Enterprise Manager, using the isql command line tool
isql/u "sa"/P "sa password"/d "master"//"EXEC sp_defaultdb n ' sa ', n ' master '"
If you use Windows authentication, use the following command line to change the default database to a database that is not missing:
isql/e/d "Master"/q "exec sp_defaultdb n ' BUILTIN\Administrators ', n ' master '"

(2) SQL Server cannot start because the system password has been changed

The solution is: Click Run, type services.msc, open the service program, locate the SQL Server project, select the property item bis-' Login ', change the login password to the operating system Administrator account login password, restart SQL Server, you can start normally.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.