当前位置:网站首页>Database knowledge: SQLServer creates non-sa user notes
Database knowledge: SQLServer creates non-sa user notes
2022-08-04 07:02:00 【IT technology sharing community】
Database security is a very important part of database operation and maintenance. Today, I will share with you how to create a non-sa user in SQL Server and set the access rights corresponding to the database. I hope it can be helpful to you.!
1. Create a login
1.1. Create a login Security→Login→New login (right mouse button)
2.2. Create a database and log in to mydb with a password of 123456.
Note: Tick off Enforce password expiration policy (F)
3. New database user
3.1 Test Database→Security→Users→New User (right mouse button)
3.2 New User Dialog
For example, the user name is mydb, the login name is mydb, and selecting the login name is actually selecting the previous step to create a login name
Click the browse button, find mydb, and click the OK button.
Click the OK button
4. Configure permissions to create users
Then switch the sa account to log in, and set the permissions of the mydb login name. Generally, users of self-built databases only need database query and write operations. The specific selection is as shown below.
Note: If you check db_owner, you will have the ability to create and delete tables, stored procedures, views, functions, and even delete databases. You can also set permissions for other users. It is not recommended to check forcustom user.
The user mapping page can adjust the non-system built-in databases that the current user can access or own, and can set the user's permissions separately.
5. Introduction to SQLServer fixed database roles
db_owner: Users in this role can perform any operation in the database.
db_accessadmin: Members of this role can add or delete users from the database.
db_backupopperator: Members of this role allow database backups.
db_datareader: Members of this role are allowed to read any data from any table.
db_datawriter: Members of this role are allowed to write data to any table.
db_ddladmin: Members of this role are allowed to add, modify or delete any object in the database (that is, execute any DDL statement).
db_denydatareader: Members of this role are denied viewing any data in the database, but they can still view it through stored procedures.
db_denydatawriter::: Like the db_denydatareader role, members of this role are denied modifying any data in the database, but they can still modify it through stored procedures.
db_securityadmin: Members of this role can change permissions and roles in the database.
public: In SQL Server 2008 every database user belongs to the public database role.When a user has not been granted or denied specific permissions on a securable object, the user will purportedly grant permissions to the securable object's public role, a database role that cannot be deleted.
边栏推荐
猜你喜欢
随机推荐
Uos统信系统 本地APT源配置
Visualization and Animation Technology (VR System)
Uos统信系统控制台欢迎登陆后消息及所处区域配置
EL expression
数据库文档生成工具V1.0
gRPC intro 1:RPC
关于网络安全行业你知道多少?
学好网络安全看这篇文章让你少走弯路
MySQL之SQL结构化查询语言
ZYNQ之FPGA LED 灯闪烁实验
VS 2017编译 QT no such slot || 找不到*** 问题
子空间结构保持的多层极限学习机自编码器(ML-SELM-AE)
为什么不使用VS管理QT项目
复杂格式的json转递
网络技巧:教你给路由器装上电池,断电照样可以上网!
网络安全行业是蓝景吗?
以太网 ARP
桌面右键的NVIDIA去除与恢复
Uos统信系统 chrony配置
SegNet——论文笔记