AWS RDS - MsSql - Create schema, user or role in quot;masterquot; or quot;msdbquot; databases(AWS RDS - MsSql - 在“master中创建架构、用户或角色或“msdb数据库)
问题描述
我使用的是 AWS RDS MsSql express V13.我正在尝试使用我在 RDS 设置期间创建的 root 用户创建架构、用户和角色,但不能.我正在使用 SQL 客户端.
I'm using AWS RDS MsSql express V13. I'm trying to create a schema, user and role using the root user I created during the RDS setup but can't. I'm using SQL client.
例如:
use [master]
CREATE USER [my_user] FOR LOGIN [my_login] WITH DEFAULT_SCHEMA=[dbo]
返回:用户无权执行此操作."
returns: "User does not have permission to perform this action."
推荐答案
AWS RDS 限制对 master 数据库的权限,因此您无法在那里创建架构、角色、用户或登录名.
AWS RDS restricts permissions on the master database, so you can't create schemas, roles, users, or logins there.
您需要创建第二个数据库,然后才能按预期创建架构、用户和角色.
You need to create a second database, which will then allow you to create schemas, users, and roles as expected.
-- use the master database to create your new database:
USE master;
CREATE DATABASE db_test;
-- then, use your new database to create your schema, login, and user:
USE db_test;
CREATE SCHEMA yourschema;
CREATE LOGIN [youruser] WITH PASSWORD = '<PASSWORD>';
CREATE USER [youruser] FOR LOGIN [youruser] WITH DEFAULT_SCHEMA = [yourschema];
这篇关于AWS RDS - MsSql - 在“master"中创建架构、用户或角色或“msdb"数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:AWS RDS - MsSql - 在“master"中创建架构、用户或
基础教程推荐
- 无法解决整理冲突 2021-01-01
- 将 SQL Server DateTime 列迁移到 DateTimeOffset 2021-01-01
- 需要 MySQL 5.1 中的抽象触发器来更新审计日志 2021-01-01
- SSMS 中的权限问题:“对象 'extended_properties'、数据库 'mssqlsystem_resource'、... 错误 229)上的 SELECT 权限被拒绝" 2022-01-01
- SQL Server 实例在登录协商期间返回无效或不受支持的协议版本 2021-01-01
- SQL:使用来自具有相同列名的两个表中的数据... 2021-01-01
- 如何使用 mysql.connector 禁用查询缓存 2022-01-01
- SQL 效率:WHERE IN 子查询 vs. JOIN 然后 GROUP 2021-01-01
- 是否可以执行按位分组功能? 2021-01-01
- 在 SQL 中连接多个表 2021-01-01
