Table of Contents
  方案二:修改服务
  附加数据库后发现数据库属性为只读的解决办法
Home Database Mysql Tutorial SQLServer2005+附加数据库时出错提示操作系统错误5(拒绝访问)错

SQLServer2005+附加数据库时出错提示操作系统错误5(拒绝访问)错

Jun 07, 2016 pm 02:55 PM
Error hint operate database

SQLServer2005+ 附加数据库时出错提示操作系统错误 5( 拒绝访问 ) 错误 5120 的解决办法 我们在用Sql SQLServer2005+附加数据库文件时弹出错误信息如下图的处理办法: 650) this.width=650;" src="http://www.68idc.cn/help/uploads/allimg/151111/12131013C

SQLServer2005+

附加数据库时出错提示操作系统错误5(拒绝访问)错误5120的解决办法

   我们在用Sql SQLServer2005+附加数据库文件时弹出错误信息如下图的处理办法: 

 

   方案一:切换登录方式

  出现这种情况是由于用“混合验证方式”(SQL Server身份验证)登录数据库造成的,只要将登录方式改为“windows身份验证方式”登录即可解决该问题,附加成功后再换用“混合验证模式”登陆就没问题了。  

  方案二:修改服务

  选择 所有程序-SQL Server 2005+-配置工具-选择"SQL Server Configuration Manager"或者“SQL Server 配置管理器”,打开“SQL Server Configuration Manager”配置界面,在左侧选择"SQL Server 2005 服务",在右侧右击打开“SQL Server (SQLEXPRESS)” 的属性,在内置账户处将网络服务--”Network Service”改为本地系统--"Local System",点击“重新启动”后再附加数据库就OK了。 

  附加数据库成功后如果担心改变设置后影响以后使用可以将内置账户处的“Local System”再改回“Network Service”,数据库仍可打开。

  主要配置过程如下图:

  1.打开“SQL Server Configuration Manager”配置界面:

  

   2.选择SqlServer(SQLEXPRESS),选项,并右击:

   

   3.选择“Local System”:

   

  4.选择“重新启动”:

  

  5.配置成功:

   

  这样配置后附加数据库就不会出错了。

   出现的问题:

   网上有人说:将数据库文件copy到其他文件夹后再附件可以附加上,但此方法经本人测试后无效。 

  附加数据库后发现数据库属性为只读的解决办法

      附加后发现数据库属性为“只读” 解决方法为: 

  打开“Sql Server 2005+”,在只读的数据库上右击选择属性,选中属性窗口左侧"选择页"下面的"选项",在窗口右边将“数据库为只读”项改为“False”,点击确定即可。

  原因:之所以附加上的数据库为“只读”,是因为启动SQL Server 的默认的启动账号“网络服务”对所附加(Attach)的数据库文件的权限不够造成的。 

  主要配置过程如图:

  步骤一:

 

  步骤二:

 

作者: EricHu 
出处:http://www.cnblogs.com/huyong/ 
Email:406590790@qq.com 
QQ交流:406590790 
关于作者:高级工程师、信息系统项目管理师、DBA。专注于微软平台项目架构、管理和企业解决方案,多年项目开发与管理经验,曾多次组织并开发多个大型项目,在面向对象、面向服务以及数据库领域有一定的造诣。现主要从事基于 RDIFramework.NET 框架的技术开发、咨询工作,主要服务于金融、医疗卫生、铁路、电信、物流、物联网、制造、零售等行业。 
如有问题或建议,请多多赐教! 
本文版权归作者和CNBLOGS博客共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,如有问题,可以通过邮箱或QQ 联系我,非常感谢。


Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How does Go language implement the addition, deletion, modification and query operations of the database? How does Go language implement the addition, deletion, modification and query operations of the database? Mar 27, 2024 pm 09:39 PM

Go language is an efficient, concise and easy-to-learn programming language. It is favored by developers because of its advantages in concurrent programming and network programming. In actual development, database operations are an indispensable part. This article will introduce how to use Go language to implement database addition, deletion, modification and query operations. In Go language, we usually use third-party libraries to operate databases, such as commonly used sql packages, gorm, etc. Here we take the sql package as an example to introduce how to implement the addition, deletion, modification and query operations of the database. Assume we are using a MySQL database.

iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos Jul 18, 2024 am 05:48 AM

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

How does Hibernate implement polymorphic mapping? How does Hibernate implement polymorphic mapping? Apr 17, 2024 pm 12:09 PM

Hibernate polymorphic mapping can map inherited classes to the database and provides the following mapping types: joined-subclass: Create a separate table for the subclass, including all columns of the parent class. table-per-class: Create a separate table for subclasses, containing only subclass-specific columns. union-subclass: similar to joined-subclass, but the parent class table unions all subclass columns.

Baidu Tieba app prompts that the operation is too frequent, what's the matter? Baidu Tieba app prompts that the operation is too frequent, what's the matter? Apr 01, 2024 pm 05:06 PM

Baidu Tieba app prompts that the operation is too frequent. This prompt is usually to maintain the normal operation and user experience of the platform to prevent malicious screen spam, advertising spam and other inappropriate behaviors. For specific handling methods, you can read the tutorial shared by the editor. Baidu Tieba app prompts that the operation is too frequent. Sharing how to deal with it 1. When the system prompts [Operation is too frequent], we need to wait for a while. If you are anxious, you can do something else first. Generally, after waiting for a while, this prompt message will It will disappear automatically and we can use it normally. 2. If after waiting for a long time, it still displays [Operation Too Frequent], we can try to go to Tieba Emergency Bar, Tieba Feedback Bar and other official Tieba, post to report this phenomenon and ask official personnel to solve it. 3.

An in-depth analysis of how HTML reads the database An in-depth analysis of how HTML reads the database Apr 09, 2024 pm 12:36 PM

HTML cannot read the database directly, but it can be achieved through JavaScript and AJAX. The steps include establishing a database connection, sending a query, processing the response, and updating the page. This article provides a practical example of using JavaScript, AJAX and PHP to read data from a MySQL database, showing how to dynamically display query results in an HTML page. This example uses XMLHttpRequest to establish a database connection, send a query and process the response, thereby filling data into page elements and realizing the function of HTML reading the database.

Detailed tutorial on establishing a database connection using MySQLi in PHP Detailed tutorial on establishing a database connection using MySQLi in PHP Jun 04, 2024 pm 01:42 PM

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

How to handle database connection errors in PHP How to handle database connection errors in PHP Jun 05, 2024 pm 02:16 PM

To handle database connection errors in PHP, you can use the following steps: Use mysqli_connect_errno() to obtain the error code. Use mysqli_connect_error() to get the error message. By capturing and logging these error messages, database connection issues can be easily identified and resolved, ensuring the smooth running of your application.

Tips and practices for handling Chinese garbled characters in databases with PHP Tips and practices for handling Chinese garbled characters in databases with PHP Mar 27, 2024 pm 05:21 PM

PHP is a back-end programming language widely used in website development. It has powerful database operation functions and is often used to interact with databases such as MySQL. However, due to the complexity of Chinese character encoding, problems often arise when dealing with Chinese garbled characters in the database. This article will introduce the skills and practices of PHP in handling Chinese garbled characters in databases, including common causes of garbled characters, solutions and specific code examples. Common reasons for garbled characters are incorrect database character set settings: the correct character set needs to be selected when creating the database, such as utf8 or u

See all articles