This topic describes how to create a database and an account on an ApsaraDB RDS for MariaDB instance.

Account types

ApsaraDB RDS for MariaDB supports two types of accounts: privileged accounts and standard accounts. You can manage all accounts and databases of your RDS instance in the ApsaraDB RDS console.
Account typeDescription
Privileged account
  • You can create and manage privileged accounts in the ApsaraDB RDS console or by calling an API operation.
  • Only one privileged account can be created for each RDS instance. A privileged account has the permissions to manage all databases and standard accounts of the RDS instance on which the privileged account is created.
  • A privileged account allows you to manage permissions at fine-grained levels based on your business requirements. For example, you can grant each standard account the permissions to query specific tables from the RDS instance on which the privileged account is created.
  • A privileged account has the permissions on all databases of the RDS instance on which the privileged account is created.
  • A privileged account has the permissions to disconnect all standard accounts of the RDS instance on which the privileged account is created.
Standard account
  • You can create and manage standard accounts by using the ApsaraDB RDS console, API operations, or SQL statements.
  • More than one standard account can be created for each RDS instance. The maximum number of standard accounts that are allowed for an RDS instance varies based on the minor engine version of the RDS instance.
  • You must grant the permissions on specific databases to standard accounts.
  • You cannot use a standard account to create, manage, or log off other accounts from the RDS instance on which the standard account is created.

Create a privileged account

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the left-side navigation pane, click Accounts.
  3. Click Create Account.
  4. Configure the following parameters.
    ParameterDescription
    Database Account

    Enter a username for the account. The username must meet the following requirements:

    • The name must start with a letter and end with a letter or a digit.
    • It can contain lowercase letters, digits, and underscores (_).
    • It must be 2 to 16 characters in length.
    Note If the username of the privileged account is the same as that of an existing standard account, the privileged account replaces the standard account.
    Account TypeSelect Privileged Account.
    Password

    Enter a password for the account. The password must meet the following requirements:

    • The password must be 8 to 32 characters in length.
    • It must contain at least three types of the following characters: uppercase letters, lowercase letters, digits, and special characters.
    • It can contain any of the following special characters: ! @ # $ % ^ & * ( ) _ + - =
    Confirm PasswordEnter the password for the account again.
    DescriptionEnter a description that helps identify the account. The description is up to 256 characters in length.
  5. Click OK.

Reset the permissions of a privileged account

If the privileged account of your RDS instance encounters exceptions such as accidentally revoked permissions, you can perform the following steps to reset the permissions:

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the left-side navigation pane, click Accounts.
  3. Find the privileged account and click Reset Permissions in the Actions column.
  4. In the dialog box that appears, specify a new password and click OK.

Create a standard account

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the left-side navigation pane, click Accounts.
  3. Click Create Account.
  4. Configure the following parameters.
    ParameterDescription
    Database Account

    Enter a username for the account. The username must meet the following requirements:

    • The username must start with a letter and end with a letter or a digit.
    • It can contain lowercase letters, digits, or underscores (_).
    • It must be 2 to 16 characters in length.
    Account TypeSelect Standard Account.
    Authorized DatabasesSpecify the databases whose permissions you want to grant to the account. You can specify one or more databases. You can leave this parameter empty and grant the account the permissions on specific databases when you create the databases. For more information, see Create a database on an ApsaraDB RDS for MariaDB instance.
    1. Select one or more databases from the Unauthorized Databases section and click the > icon to add them to the Authorized Databases section.
    2. In the Authorized Databases section, select the Read/Write (DDL + DML), Read-only, DDL Only, or DML Only permissions for each database.

      If you want to grant the same permissions on more than one database at a time, select the databases and configure the Set All to parameter in the upper-right corner of the Authorized Database section to grant related permissions on the selected authorized databases. For example, you can set the parameter to Read/Write (DDL + DML).

      Note The parameter settings in the upper-right corner change after you click them. For example, if you click the Read/Write (DDL + DML) value, the value changes to (Read-only).
    Password

    Enter a password for the account. The password must meet the following requirements:

    • The password must be 8 to 32 characters in length.
    • It must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.
    • It can contain any of the following special characters: ! @ # $ % ^ & * ( ) _ + - =
    Confirm PasswordEnter the password for the account again.
    DescriptionEnter a description that helps identify the account. This parameter is optional. The description is up to 256 characters in length.
  5. Click OK.

Create a database

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the left-side navigation pane, click Databases.
  3. Click Create Database.
  4. Configure the following parameters.
    ParameterDescription
    Database Name
    • The name must start with a letter and end with a letter or a digit.
    • It can contain lowercase letters, digits, underscores (_), and hyphens (-).
    • It must be 2 to 64 characters in length.
    Supported Character SetThe character set of the database.
    Authorized AccountThe account to which you want to grant the permissions on the database. You can leave this parameter empty. You can grant the permissions on a database to an account after the database is created. For more information, see Modify the permissions of a standard account on an ApsaraDB RDS for MariaDB instance.
    Note The Authorized Account drop-down list displays only the standard accounts that are created on your RDS instance. The privileged account has all permissions on all databases and does not require authorization.
    Account TypeSelect the permissions that you want to grant to the selected accounts. You can select Read/Write, Read-only, DDL Only, or DML Only.
    DescriptionEnter a description that helps identify the account. This parameter is optional. The description can be up to 256 characters in length.
  5. Click OK.

Related operations

OperationDescription
CreateAccountCreates an account on an instance.
CreateDatabaseCreates a database on an instance.