問題描述
我使用的是 AWS RDS MsSql express V13.我正在嘗試使用我在 RDS 設置期間創(chuàng)建的 root 用戶創(chuàng)建架構(gòu)、用戶和角色,但不能.我正在使用 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]
返回:用戶無權(quán)執(zhí)行此操作."
returns: "User does not have permission to perform this action."
推薦答案
AWS RDS 限制對 master
數(shù)據(jù)庫的權(quán)限,因此您無法在那里創(chuàng)建架構(gòu)、角色、用戶或登錄名.
AWS RDS restricts permissions on the master
database, so you can't create schemas, roles, users, or logins there.
您需要創(chuàng)建第二個數(shù)據(jù)庫,然后才能按預期創(chuàng)建架構(gòu)、用戶和角色.
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"中創(chuàng)建架構(gòu)、用戶或角色或“msdb"數(shù)據(jù)庫的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!