sqlserver2005+
Error when attaching database error 5 (Access denied) error 5120 workaround
When we attach a database file with SQL sqlserver2005+, the error message is handled as follows:
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:
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.
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:
Step Two:
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.
sqlserver2005+ error when attaching a database prompt for operating system error 5 (Access denied) 5120 workaround