SQL Server cannot open the workaround for user default database logon failure error 4064 _mssql2005

Source: Internet
Author: User

The user default database could not be opened and the login failed because the default database for the login account was deleted.

The workaround is to use the Administrator account to modify the default database for this login account.

1. Log in to Enterprise Manager using the Administrator account, in Object Explorer, expand Security--"Login name", right-click the account and click "Properties"



2. In the "Login Properties" dialog box, change the default database to the right of the first General tab interface.




If the problem is your administrator account, you cannot log in to the Enterprise Manager to modify, you can use the following command,

SQL Server 2000 users open the CMD command prompt and use the following command:

SQL Account Login mode: isql-u "password"-P "jtydl"-D "master"-Q "exec sp_defaultdb n ' sa ', n ' master '"

Windows Authentication Login mode: ISQL-E-D "Master"-Q "exec sp_defaultdb n ' builtin/administrators ', n ' master '"

SQL Server 2005 users cannot use the isql command because there is no isql in the SQL 2005 version, and the Internet is reproduced isql usage without saying that there is no such command in SQL 2005, the problem

It bothered me for half an hour and finally found it, SQL2005 but a new sqlcmd command was added to replace isql. Just change the above isql to SQLCMD, also at the cmd command prompt

Face input.

The general reason for this error:

1, mistakenly deleted the default database.
2. The default database is restored by using a different physical path to back up the database, which may cause the above error.

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.