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

Source: Internet
Author: User

sqlserver2005+

Error prompting operating system error when attaching database 5 ( access denied ) Error 5120 the solution

When we attach a database file with SQL sqlserver2005+, the error message is handled as follows:

650) this.width=650; "src=" Http://images.cnitblog.com/blog2015/157572/201504/130944166356370.png "style=" border:0 px; "/>

Scenario One: Switch login mode

This occurs because of the "Mixed authentication Mode" (SQL Server Authentication) to log on to the database, as long as the login to the "Windows authentication method" Login To resolve the problem, the additional success after the "Mixed authentication Mode" Landing there is no problem.

Scenario Two: Modify the service

Select All Programs-sql Server 2005+-Configuration Tool-Select SQL Server Configuration Manager or SQL Server Configurations Manager to open SQL Server config Manage R "Configure the interface, select" SQL Server 2005 Services "on the left, and right-click on the right side of the SQLEXPRESS to open the" SQL Server "property, and in the built-in account, change the network service – System ", click" Restart "and then attach the database is OK.

After the attached database is successful, if you worry about changing the settings after the change, you can change the "Local System" in the built-in account back to "Network Service" and the database can still be opened.

The main configuration process is as follows:

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

650) this.width=650; "src=" Http://images.cnitblog.com/blog2015/157572/201504/130945037609006.png "style=" border:0 px; "/>

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

650) this.width=650; "src=" Http://images.cnitblog.com/blog2015/157572/201504/130945432458678.png "style=" border:0 px; "/>

3. Select "Local System":

650) this.width=650; "src=" Http://images.cnitblog.com/blog2015/157572/201504/130946332149313.png "style=" border:0 px; "/>

4. Select "Restart":

650) this.width=650; "src=" Http://images.cnitblog.com/blog2015/157572/201504/130946441042219.png "style=" border:0 px; "/>

5. Configuration success:

650) this.width=650; "src=" Http://images.cnitblog.com/blog2015/157572/201504/130947047455646.png "style=" border:0 px; "/>

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.

workaround for discovering database properties as read-only after attaching a database

After attaching, the Discovery database property is "Read Only" Workaround:

Open SQL Server 2005+, right-click the Select property on the read-only database, select options under "Select Page" on the left side of the Properties window, and on the right side of the window, change the "database read-only" entry to "False" and click OK.

Cause: The database attached is read-only because the default startup account for SQL Server "Network SERVICE" has insufficient permissions to the attached (Attach) database file.

Main configuration process

Step One:

650) this.width=650; "src=" Http://images.cnitblog.com/blog2015/157572/201504/130948128232682.png "style=" border:0 px; "/>

Step Two:

650) this.width=650; "src=" Http://images.cnitblog.com/blog2015/157572/201504/130948229324459.png "style=" border:0 px; "/>

Erichu
Source:http://www.cnblogs.com/huyong/
Email:[email protected]
QQ Communication:406590790
about senior engineer, information System Project Manager, DBA. Focused on Microsoft platform Project architecture, management and enterprise solutions, multi-year project development and management experience, has organized and developed several large projects, in the object-oriented, service-oriented and database areas have a certain degree of accomplishment. is now mainly engaged in based onrdiframework.netframework of technical development, consulting work, mainly services in finance, health, railways, telecommunications, logistics, Internet of things, manufacturing, retail and other industries.
If you have any questions or suggestions, please enlighten me!
This article is copyright to the author and Cnblogs blog, welcome to reprint, but without the author's consent must retain this paragraph statement, and in the article page obvious location to the original connection, if there is a problem, you can contact me by email or QQ, thank you very much.


This article is from ". NET rapid Development Framework blog, be sure to keep this source http://yonghu.blog.51cto.com/8166136/1631736

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.