This topic describes how to create an account that is used to manage the databases of an ApsaraDB RDS for MySQL instance.
Prerequisites
An ApsaraDB RDS for MySQL instance is created. For more information, see Create an ApsaraDB RDS for MySQL instance..Account types
ApsaraDB RDS for MySQL supports two types of accounts: privileged accounts and standard accounts. You can manage all the accounts and databases of your RDS instance by using the ApsaraDB RDS console. For more information about the permissions that can be granted to each type of account, see Account permissions.Account type | Description |
---|---|
Privileged account |
|
Standard account |
|
Account type | Maximum number of databases | Maximum number of tables | Maximum number of accounts |
---|---|---|---|
Privileged account | MySQL has no limit on the number of databases. The underlying file system may have a limit on the number of directories. | < 200,000 | Varies based on the minor engine version. |
Standard account | < 200,000 | Varies based on the minor engine version. |
Create a privileged account
- Access RDS Instances, select a region at the top, and then click the ID of the target RDS instance.
- In the left-side navigation pane, click Accounts.
- Click Create Account.
- Configure the following parameters.
Parameter Description Database Account Enter a username for the account. The username must meet the following requirements:
- If your RDS instance runs MySQL 5.6, the username must be 2 to 16 characters in length. If your RDS instance runs MySQL 8.0 or MySQL 5.7, the username must be 2 to 32 characters in length.
- The username must start with a lowercase letter and end with a lowercase letter or digit.
- The username can contain lowercase letters, digits, and underscores (_).
- The username cannot be the same as the username of an existing account.
Account Type Select Privileged Account. Password Enter a password for the account. The username must meet the following requirements:
- The password must be 8 to 32 characters in length.
- The password must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.
- The password can contain the following special characters: ! @ # $ % ^ & * ( ) _ + - =
Note If your RDS instance runs MySQL 5.7, you can configure a custom password policy for your instance. For more information, see Configure a custom password policy for an ApsaraDB RDS for MySQL instance.Confirm Password Enter the password for the account again. Description Enter a description that is used to identify the account. The description can be up to 256 characters in length. - Click Create.
Reset the permissions of a privileged account
If the privileged account of your RDS instance encounters exceptions, for example, the permissions are accidentally revoked, you can perform the following steps to reset the permissions:
- Access RDS Instances, select a region at the top, and then click the ID of the target RDS instance.
- In the left-side navigation pane, click Accounts.
- Find the account whose Account Type is Privileged Account. Then, click Reset Permissions in the Actions column.
- In the dialog box that appears, enter the password of the privileged account and click OK.
Create a standard account
- Access RDS Instances, select a region at the top, and then click the ID of the target RDS instance.
- In the left-side navigation pane, click Accounts.
- Click Create Account.
- Configure the following parameters.
Parameter Description Database Account Enter a username for the account. The username must meet the following requirements:
- If your RDS instance runs MySQL 5.6, the username must be 2 to 16 characters in length. If your RDS instance runs MySQL 8.0 or MySQL 5.7, the username must be 2 to 32 characters in length.
- The username must start with a lowercase letter and end with a lowercase letter or digit.
- The username can contain lowercase letters, digits, and underscores (_).
- The username cannot be the same as the username of an existing account.
Account Type Select Standard Account. Authorized Databases Specify the authorized databases of the account. You can specify one or more authorized databases. You can leave this parameter unspecified. In this case, you can grant the permissions on specific databases to the account after the account is created. - In the Unauthorized Databases section, select one or more databases. Then, click the > icon to move the selected databases to the Authorized Databases section.
- In the Authorized Databases section, select the Read/Write (DDL + DML), Read-only, DDL Only, or DML Only permissions for each authorized database.
If you want to grant the same permissions on more than one authorized database at a time, select the authorized databases and click the Set All to button in the upper-right corner of the Authorized Database section. For example, you can click the button to grant the Read/Write (DDL + DML) permissions on the selected authorized databases.
Note For more information, see Account permissions.
Password Enter a password for the account. The username must meet the following requirements:
- The password must be 8 to 32 characters in length.
- The password must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.
- The password can contain the following special characters: ! @ # $ % ^ & * ( ) _ + - =
Note If your RDS instance runs MySQL 5.7, you can configure a custom password policy for your instance. For more information, see Configure a custom password policy for an ApsaraDB RDS for MySQL instance.Confirm Password Enter the password for the account again. Description Enter a description that is used to identify the account. The description can be up to 256 characters in length. - Click Create.
FAQ
- Can I configure an account to have only the permissions to access my RDS instance over an internal network?
Yes, you can use SQL statements to specify the source IP address from which an account can access your RDS instance. For more information, see Authorize an account to access its authorized databases from specified IP addresses in an ApsaraDB RDS for MySQL instance. However, this operation is not supported in the ApsaraDB RDS console.
- Can I configure the permissions of an account at finer-grained levels, such as the table level?
Yes, you can use SQL statements to manage the permissions of an account at finer-grained levels. For more information, see Authorize accounts to manage tables, views, and fields. However, this operation is not supported in the ApsaraDB RDS console.
Related operations
Operation | Description |
---|---|
CreateAccount | Creates an account that is used to manage the databases of an RDS instance. |