This topic describes how to create databases and accounts for an RDS instance in SQL Server 2017 EE. You must create a premier account through the RDS console, and then use a database client or DMS to create and manage databases.
The SQL Server version is 2017 EE.
- Databases within the same instance share all the resources of the instance. You can manage standard accounts and databases by using SQL statements.
- When assigning permissions to database accounts, follow the principle of least privilege and create accounts based on the roles required. Assign the appropriate level of permissions to the accounts. When necessary, you can create multiple database accounts and allow each of them to access data relevant to their own business tasks. If an account does not need to write data to a database, assign read-only permissions to the account.
- For database security, you must set strong account passwords and change the passwords regularly.
- Log on to the RDS console.
- Select the target region.
- Find the target RDS instance and click the instance ID.
- In the left-side navigation pane, click Accounts.
- Click Create Initial Account.
- Enter the account information.
- Database Account: The name of the premier account. The account name must be 2 to 16 characters in
length and can contain lowercase letters, numbers, and underscores (_). It must start
with a letter and end with a letter or number.
Note Reserved keywords such as test and root cannot be set as account names.
- Password: The password of the premier account.
- The password must be 8 to 32 characters in length.
- The password must contain at least three of the following types of characters: uppercase letters, lowercase letters, numbers, and special characters.
- The allowed special characters are as follows:
! @ # $ % ^ & * ( ) _ + - =
- Re-enter Password: Enter the password again.
- Database Account: The name of the premier account. The account name must be 2 to 16 characters in length and can contain lowercase letters, numbers, and underscores (_). It must start with a letter and end with a letter or number.
- Click Create.
- Click Log On to DB in the upper-right corner to go to the RDS Database Logon page of the Data Management Service console.
- Enter the correct IP address, port number, database username, and password.
- 1: The IP address and port information of the RDS instance. You can view the IP address and port information on the Basic Information page or Database Connection page.
- 2: The name of the account to access the database.
- 3: The password of the account to access the database.
- Click Log On.
Note If you want your browser to remember your account and password, you can select Remember Password before you click Log On.
- If the system displays a message, asking you to add the CIDR block of the DMS server to the IP address whitelist of the RDS instance, click Set a Whitelist. For more information, see Configure a whitelist for an RDS SQL Server instance.
- After the whitelist is configured, click Log On.
- After you have logged on to the RDS instance, choose in the top navigation bar.
- In the SQL window, run the following statement to create a database:
create database <database name>;
- Click execute.
- In the SQL window, run the following statement to create a standard account:
CREATE LOGIN <login name> WITH PASSWORD = '<password>';
- Click execute.
Note Standard accounts that are created in DMS by using T-SQL do not appear in the account list in the console. However, you can use a standard account to log on to the database.
- In the SQL window, run the following statements to create a database user and associate
the user to the standard account that you have created.
USE <database name>; CREATE USER <user name> FOR LOGIN <login name>;
- Click execute. The standard account can access the corresponding database.
Can I manage the created account in the read-only instances?
The account created in the master instance is synchronized to the read-only instances. You cannot manage the account in the read-only instances. The account can only read data from the read-only instances.
|CreateAccount||Used to create an account for an RDS instance.|
|CreateDatabase||Used to create a database an RDS instance.|