Before applications can connect to your ApsaraDB RDS for MariaDB instance, you must create at least one account and one database on the instance.
Account types
ApsaraDB RDS for MariaDB supports two account types. Both are managed through the ApsaraDB RDS console.
| Property | Privileged account | Standard account |
|---|---|---|
| Limit per instance | One | Multiple (varies by minor engine version) |
| Management methods | Console or API | Console, API, or SQL statements |
| Database permissions | All databases | Only authorized databases |
| Manage standard accounts | Yes | No |
| Disconnect any account | Yes | No |
| Fine-grained per-table permissions | Yes | No |
If a privileged account username matches an existing standard account, the privileged account replaces that standard account.
Prerequisites
Before you begin, make sure that you have:
An ApsaraDB RDS for MariaDB instance in the Running state
An Alibaba Cloud account with permissions to manage the RDS instance
Create a privileged account
Go to the Instances page. In the top navigation bar, select the region of your RDS instance. Find the instance and click its ID.
In the left-side navigation pane, click Accounts.
Click Create Account.
Configure the following parameters.
Parameter Description Database Account Enter a username. Requirements: starts with a letter, ends with a letter or digit, contains only lowercase letters, digits, or underscores (_). Length: 2-16 characters. Account Type Select Privileged Account. New Password Enter a password. Length: 8-32 characters. Must contain at least three of these character types: uppercase letters, lowercase letters, digits, and special characters (! @ # $ % ^ & * ( ) _ + - =). Confirm Password Re-enter the password. Description Optional. A note to identify the account. Maximum: 256 characters. Click OK.
If the privileged account username matches an existing standard account, the privileged account replaces the standard account.
Result
The new privileged account appears on the Accounts page with full permissions on all databases.
Create a standard account
Go to the Instances page. In the top navigation bar, select the region of your RDS instance. Find the instance and click its ID.
In the left-side navigation pane, click Accounts.
Click Create Account.
Configure the following parameters.
Parameter Description Database Account Enter a username. Requirements: starts with a letter, ends with a letter or digit, contains only lowercase letters, digits, or underscores (_). Length: 2-16 characters. Account Type Select Standard Account. Authorize Database: Optional. Grant the account permissions on one or more databases. Select databases from the left panel and click the arrow icon to add them to the right panel. Then select a permission level for each database: Read/Write (DDL + DML), Read-Only, DDL Only, or DML Only. To apply the same permission to all databases, click the batch button such as Set All To Read/Write (DDL+DML). Leave blank to grant permissions later. New Password Enter a password. Length: 8-32 characters. Must contain at least three of these character types: uppercase letters, lowercase letters, digits, and special characters (! @ # $ % ^ & * ( ) _ + - =). Confirm Password Re-enter the password. Description Optional. A note to identify the account. Maximum: 256 characters. Click OK.
Result
The new standard account appears on the Accounts page. Permissions apply only to databases that you explicitly authorized.
Create a database
Go to the Instances page. In the top navigation bar, select the region of your RDS instance. Find the instance and click its ID.
In the left-side navigation pane, click Databases.
Click Create Database.
Configure the following parameters.
Parameter Description Database Name Enter a database name. Requirements: starts with a letter, ends with a letter or digit, contains only lowercase letters, digits, underscores (_), or hyphens (-). Length: 2-64 characters. Supported Character Set Select the character set for the database. Authorized By Optional. Select a standard account to grant permissions on this database. The privileged account is not listed because it automatically has full permissions on all databases. Leave blank to grant permissions later. For more information, see Modify or reset account permissions. Description Optional. A note to identify the database. Maximum: 256 characters. Click Create.
Result
The new database appears on the Databases page. If you selected an account in Authorized By, that account is granted the specified permissions on this database.
Reset privileged account permissions
If the privileged account of your RDS instance encounters exceptions such as accidentally revoked permissions, you can reset the permissions by performing the following steps.
Go to the Instances page. In the top navigation bar, select the region of your RDS instance. Find the instance and click its ID.
In the left-side navigation pane, click Accounts.
Find the Privileged Account and click Reset Account Permissions in its row.
Enter and confirm a new password for the privileged account, and then click OK.
Result
The privileged account regains full permissions on all databases and standard accounts.
Related API operations
| API | Description |
|---|---|
| CreateAccount | Create an account on an RDS instance |
| CreateDatabase | Create a database on an RDS instance |