[Effective by use] Sqlserver2005 error when attaching a database prompt for operating system error 5 (Access denied) 5120 workaround

Source: Internet
Author: User

sqlserver2005 error when attaching a database prompt for operating system error 5 (Access denied) 5120 workaround

Several web-based login cases have been found on the internet in recent days to study the code, with the result

SQL Server2005 error message when attaching a database file: such as:

, a moment without solution, then turned to Baidu Google, after a variety of experiments, special will solve the solution in this, hoping to help everyone, at the same time, if there are good views we have a lot of exchanges Ah!

Scenario One: Switch login mode

This occurs because of a "Mixed Authentication" (SQL Server Authentication) logon to the database, as long as the logon mode is changed to "Windows Authentication Mode"

Log in to solve the problem, after the addition of the success of the "Mixed authentication Mode" Landing there is no problem.

This method was successfully tested by me.

Scenario Two: Modify the service

Select All Programs-sql Server 2005-Configuration tools-Select SQL Server Configuration Manager or SQL Server Config Manager,

Open the SQL Server Configuration Manager config interface, select SQL Server 2005 services on the left, and right-click on the right side of the SQLEXPRESS to open the properties of SQL Server (*. *), and set the network service in the built-in account--" Network Service changed to local system-

Click "Restart" and then attach the database is OK.

This method was successfully tested by me.

After the attached database is successful, if you worry about changing the settings, you can change the "Local System" in the built-in account back to

Network Service, the database can still be opened.

The main configuration process is as follows:

1. Open the "SQL Server configuration Manager" Config interface:

2. Select the SQL Server (SQLEXPRESS) option, and right-click:

3. Select "Local System":

4. Select "Restart":

5. Configuration success:

With this configuration, attaching the database will not be an error.

Problems that arise:

Someone online said: Copy the database file to a different folder before attachments can be attached, but this method after I test invalid.

[Effective by use] Sqlserver2005 error when attaching a database prompt for operating system error 5 (Access denied) 5120 workaround

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.