当前位置:网站首页>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.
边栏推荐
猜你喜欢
怎样才能转行成功?
数据库:整理四个实用的SQLServer脚本函数
子空间结构保持的多层极限学习机自编码器(ML-SELM-AE)
华硕飞行堡垒系列无线网经常显示“无法连接网络” || 一打开游戏就断网
Arduino之ESP8266编程学习总结体会
Memory limit should be smaller than already set memoryswap limit, update the memoryswap at the same
ZYNQ之FPGA LED 灯闪烁实验
QT QOpenGLWidget 全屏导致其他控件显示问题
网络技巧:教你给路由器装上电池,断电照样可以上网!
基于爬行动物搜索RSA优化LSTM的时间序列预测
随机推荐
Scheduler (Long-term,Short-term, Medium-term Scheduler) & Dispatcher
RHCE之路----全
电脑知识:台式电脑应该选择品牌和组装,值得收藏
无一技之长学什么可以做到月入上万?
给想要转行渗透测试人的忠告
IP 核之 MMCM/PLL 实验
怎样才能转行成功?
一场聚会,转行渗透测试月薪13.5k,感谢那个女同学......
Logical Address & Physical Address
把DocumentsandSettings迁移到别的盘
基于时序模式注意力机制(TPA)的长短时记忆(LSTM)网络TPA-LSTM的多变量输入风电功率预测
并发概念基础:线程,死锁
sql常用函数
基于Webrtc和Janus的多人视频会议系统开发4 - 改造信令交互系统完成sdp交换过程
基于Webrtc和Janus的多人视频会议系统开发5 - 发布媒体流到Janus服务器
狗都能看懂的Vision Transformer的讲解和代码实现
用PPAPI插件技术在Web上显示会议视频、桌面、PPT等
冰歇webshell初探
网络安全学习的三大不可取之处
Unity Day03