SQL Server 2005 error attaching database prompts operating system error 5 (Access denied) error 5120 solution _mssql2005

Source: Internet
Author: User
Tags mixed management studio sql server management sql server management studio

A few days from the internet to find a few ASP.net login cases to study the code, the results of the use of SQL Server2005 attached to the database file pop-up error message:

See Netizen Reply said: Just give authenticated users all permissions on the line.

I also encountered a similar problem, but the solution is simple, you need to use the administrator's identity to open SQL Server Management Studio, you can attach the database

The following figure:

, temporarily no solution, and then turn to Baidu Google, after a variety of experiments, special will solve the solution in this, hope to help everyone, at the same time, if there is a good opinion of everyone a lot of exchanges Ah!

Option one: Switch login mode

This occurs because of the use of mixed authentication (SQL Server Authentication) to log on to the database, as long as you change the logon mode to "Windows Authentication Mode"

Login to resolve the problem, the additional success after the replacement of "Mixed authentication Mode" Landing will be no problem.

This method was successfully tested by myself.

Programme II: Modifying services

Select All Programs-sql Server 2005-Configuration tool-Select SQL Server Configuration Manager or SQL Server Configuration Manager.

Open the SQL Server Configuration Manager Configuration interface, select SQL Server 2005 service on the left, right-click on the properties of SQL Server (SQLEXPRESS) on the right, and network services in the built-in account-" Network Service "Local System" instead

Click on "reboot" and then attach the database OK.

This method was successfully tested by myself.

After the additional database is successful, if you are worried about changing the settings, you can change the "local System" of the built-in account back to

"Network Service", the database can still be opened.

The main configuration process is shown below:

1. Open the SQL Server Configuration Manager Configuration Interface:

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

3. Select "Local System":

4. Select "Reboot":

5. Configuration success:

This will not be an error if you attach the database after this configuration.

The problems that arise:

Someone on the internet said: Copy the database files to other folders and attachments can be attached, but this method after I test invalid.

Solution to discovering database properties as read-only after attaching a database

The append found that the Database property is read-only resolution is:

Open Sql Server??, and Right-click the selected property on the read-only database, select options under Select Page on the left of the Properties window, and on the right side of the window, make the database read-only item

Change to "False" and click OK.

Reason: The database attached is "read-only" because the default startup account "Network Service" that starts SQL Server has an attached (Attach) database file

Due to insufficient authority. This method was successfully tested by myself.

The main configuration process is as shown:

Step One:

Step Two:

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.