如何在sql server 2008中锁定数据库? [英] How to lock database in sql server 2008?

查看:86
本文介绍了如何在sql server 2008中锁定数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的特定项目的数据库上应用密码,所以除了我之外没有人可以改变它!

我该怎么做?

解决方案

SQL服务器体系结构不是(并且其他任何rdbms体系结构都不是 - 除了可能是嵌入式体系结构)这样做 - 因为身份验证/授权机制比这更复杂。我建议你阅读这篇文章: http://msdn.microsoft.com/en-us/library/ bb669078.aspx [ ^ ]



[更新]

首先,如果你制作Windows应用程序,请不要在asp.net上标记你的问题。 />
第二:如果你想完全隐藏数据库内容,sql server不是最好的方法。正如我所提到的,管理员(本地Windows管理员也是)在sql server中是超级用户。由于其他原因,在这种情况下使用sql server可能不是最好的选择。加密数据库是SQL Server Enterprise的一项功能,我很确定您不会为Windows应用程序部署此版本。使用SQL server express,您没有真正的选择。使用SQL CE,你有。请参阅: http://msdn.microsoft.com/en-us/library/gg592949.aspx [ ^ ],但请注意保持密码安全 - 如果你必须在客户端计算机上安装所有内容,这真的很难。

你有其他嵌入式数据库引擎可供选择,它有内置或第三方加密,如作为SQLite: http://sqlcipher.net/ [ ^ ], http://www.sqlite-crypt.com/? gclid = CLrd242v5bcCFVMQtAod23YAmQ [ ^ ],< a href =http://www.sqlite-encrypt.com/> http://www.sqlite-encrypt.com/ [ ^ ]


例如,请参阅此 Stack Overflow 的问题:设置SQL Server 2008数据库的密码 [ ^ ]。

您正在谈论软件,并且您已将问题标记为ASP.NET.Tag it proper。



此外,我建议您使用比如角色管理.Eg有两个用户Gaurav(管理员)和rohan(用户),然后如果rohan登录则撤销访问权限,并且仅当gaurav登录时才允许。仅将数据库相关功能应用于管理员,而不是普通用户。



请参阅以下链接,这些链接在角色管理方面非常重要。



Windows窗体:



安全的基于角色的Windows窗体 [ ^ ]



基于控件的Windows窗体应用程序中的安全性 [ ^ ]



在Windows窗体或控制台应用程序中使用内置的ASP.NET角色提供程序 [ ^ ]



网络应用程序/网站:



了解ASP.NET角色和成员资格 - A初学者教程 [ ^ ]



按角色验证用户在ASP.NET 中[ ^ ]



了解角色管理 [ ^ ]



如何:使用角色管理器 [ ^ ]





问候......:笑:


I want to apply password on my particular project's database, so no one can alter that except me!
How can i do that?

解决方案

The SQL server architecture isn't (and neither other rdbms architecture is - except of maybe the embedded ones) made like this - because the authentication/authorization mechanism is more complex than that. I suggest you read trough this article: http://msdn.microsoft.com/en-us/library/bb669078.aspx[^]

[update]
First of all, if you make windows application, don't tag your question asp.net.
Second: if you want to hide database content completely, sql server is not the best approach. As I mentioned, administrator (local windows administrator also) is superuser in sql server. And using sql server might not be the best choice in such cases for other reasons too. Encrypted database is a feature from SQL Server Enterprise, and I am pretty sure you won't deploy this edition for a windows application. With SQL server express you have no real choices. With SQL CE you have. See: http://msdn.microsoft.com/en-us/library/gg592949.aspx[^], but be aware to keep the password safe - which is really hard if you have to install everything on the client computer.
You have other embedded database engines to choose from, which have built-in, or third party encryption, such as SQLite: http://sqlcipher.net/[^], http://www.sqlite-crypt.com/?gclid=CLrd242v5bcCFVMQtAod23YAmQ[^], http://www.sqlite-encrypt.com/[^]


See, for instance, this Stack Overflow's question: "Set password for SQL Server 2008 database"[^].


You are talking about software and you have tagged question as ASP.NET.Tag it properly.

Further,i recommend you to use something like role management.E.g. There are two users Gaurav(admin) and rohan(user),then revoke access if rohan logs in,and allow only if gaurav logs in.Apply database related functionality only to admin,not to normal user.

Refer to below links which are very important as per as the role management is concerned.

Windows Forms:

A Secure Role-based Windows Form[^]

Controls Based Security in a Windows Forms Application[^]

Using the built in ASP.NET Role provider in Windows Forms or Console applications[^]

Web Application/Websites:

Understanding ASP.NET Roles and Membership - A Beginner's Tutorial[^]

Authenticate User by Roles in ASP.NET[^]

Understanding Role Management[^]

How To: Use Role Manager[^]


Regards..:laugh:


这篇关于如何在sql server 2008中锁定数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆