当前位置:网站首页>sqlserver SQL Server Management Studio和Transact-SQL创建账户、创建访问指定数据库的只读用户
sqlserver SQL Server Management Studio和Transact-SQL创建账户、创建访问指定数据库的只读用户
2022-06-30 17:46:00 【但行益事莫问前程】
前言
1. Create a Login
文档中介绍了using SQL Server Management Studio (SSMS) 和Transact-SQL2种方式,本人创建只读账户使用的第一种方式;
2. 创建访问指定数据库的只读用户
(1)使用Microsoft SQLServer Management Studio,用管理员账户登录
(2)点击【安全性】->【登录名】,选择【新建登录名】
(3)在【常规】选项【登录名】中输入用户名 cz。身份验证选择【SQL Server 身份验证】,输入密码,取消勾选【强制实施密码策略】
(4)点击选项页【用户映射】->【映射到此登录名的用户】,选择创建的cz用户可操作的数据库。针对每一个数据库,在下方【数据库角色成员身份】中勾选成员身份,即可获取身份对应的权限,如只读权限,即勾选【db_datareader】。同时【默认架构】中亦勾选【db_datareader】

(6)只读用户cz创建成功
连接成功:
修改数据报错:
备注:服务器角色

bulkadmin check box
Members of the bulkadmin fixed server role can run the BULK INSERT statement.
dbcreator check box
Members of the dbcreator fixed server role can create, alter, drop, and restore any database.
diskadmin check box
Members of the diskadmin fixed server role can manage disk files.
processadmin check box
Members of the processadmin fixed server role can terminate processes running in an instance of the Database Engine.
public check box
All SQL Server users, groups, and roles belong to the public fixed server role by default.
securityadmin check box
Members of the securityadmin fixed server role manage logins and their properties. They can GRANT, DENY, and REVOKE server-level permissions. They can also GRANT, DENY, and REVOKE database-level permissions. Additionally, they can reset passwords for SQL Server logins.
serveradmin check box
Members of the serveradmin fixed server role can change server-wide configuration options and shut down the server.
setupadmin check box
Members of the setupadmin fixed server role can add and remove linked servers, and they can execute some system stored procedures.
sysadmin check box
Members of the sysadmin fixed server role can perform any activity in the Database Engine.
边栏推荐
- TiDB Dashboard里面可以写sql执行吗
- Summary of methods for offline installation of chrome extensions in China
- slice
- What if the apple watch fails to power on? Apple watch can not boot solution!
- The cloud native landing practice of using rainbow for Tuowei information
- OneFlow源码解析:算子签名的自动推断
- How does rust implement dependency injection?
- Swin-transformer --relative positional Bias
- 深度学习编译器的理解
- 「经验」浅谈聚类分析在工作中的应用
猜你喜欢
随机推荐
充值满赠,IM+RTC+X 全通信服务「回馈季」开启
如何利用AI技术优化独立站客服系统?听听专家怎么说!
TCP packet sticking problem
屏幕显示技术进化史
使用excel快速生成sql语句
C# Winform程序界面优化实例
NEON优化2:ARM优化高频指令总结
Where do the guests come from
3.10 haas506 2.0开发教程-example-TFT
拓维信息使用 Rainbond 的云原生落地实践
详解单例模式
CODING 正式入驻腾讯会议应用市场!
Can go struct in go question bank · 15 be compared?
Techo Youth2022学年高校公开课:直播连麦的背后,探索音视频技术如何应用
countdownlatch 和 completableFuture 和 CyclicBarrier
音频 librosa 库 与 torchaudio 库中 的 Mel- spectrogram 进行对比
深度学习编译器的理解
Do you really understand the persistence mechanism of redis?
一套十万级TPS的IM综合消息系统的架构实践与思考
Pytorch learning (III)








