SQL Server opens default database login failure error 4064 how to solve

Source: Internet
Author: User

The default database cannot be opened. Logon fails because the default database of the logon account is deleted.

The solution is to use the administrator account to modify the default database of the logon account.

1. Log on to the enterprise manager using the administrator account. In "object Resource Manager", choose "security"> "logon name", right-click the Account, and click "properties"

 

2. In the "logon properties" dialog box, change the default database on the right of the first "General" tab.

 

If the problem is caused by your administrator account and you cannot log on to the Enterprise Manager to modify it, run the following command,

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

SQL Account logon method: isql-U "password"-P "jtydl"-d "master"-Q "exec sp_defaultdb N 'sa ', N 'master '"

Windows Authentication logon method: isql-E-d "master"-Q "exec sp_defaultdb N 'builtin/Administrators ', N 'master '"

SQL Server 2005 users cannot use the isql command, because SQL 2005 does not have isql, and isql usage is reproduced on the Internet without saying that this command is not available in SQL 2005.

After more than half an hour, I finally found SQL2005, but added a sqlcmd command to replace isql. You only need to replace isql with sqlcmd.

Area input.

The general cause of this error:

1. The default database is deleted by mistake.

2. When the default database is used to restore the database, another physical path is used to restore the database. The above error may occur.

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.