Learn how to create database accounts for an ApsaraDB RDS for MySQL or instance.
Prerequisites
You have created an ApsaraDB RDS for MySQL instance.
To create a RAM user for your Alibaba Cloud account and grant the RAM user permissions to manage instances, see Create a RAM user.
Account types
ApsaraDB RDS for MySQL or instances support two types of database accounts: privileged accounts and standard accounts. You can manage all accounts and databases in the ApsaraDB RDS console. For details about the permissions of each account type, see List of account permissions.
You cannot change an account's type after you create it. You can delete the account and then create a new one with the same name.
Account type | Description |
Privileged Account |
|
Standard Account |
|
Account type | Number of databases | Number of tables | Number of users |
privileged account | Unlimited | < 200,000 | Depends on the kernel parameters of the instance |
standard account | 500 | < 200,000 | Depends on the kernel parameters of the instance |
The maximum number of directories supported by the underlying file system may limit the number of databases you can create.
Create a privileged account
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.
In the left-side navigation pane, click Accounts.
Click Create Account.
Configure the following parameters.
Parameter
Description
Database Account
Enter a name for the account. The name must meet the following requirements:
The account name must be 2 to 16 characters in length for MySQL 5.6, and 2 to 32 characters in length for MySQL 8.0 and MySQL 5.7.
It must consist of letters, digits, and underscores (_).
It must start with a letter and end with a letter or digit.
The name must be unique within the instance.
The name of a standard account cannot be similar to the name of the privileged account. For example, if the privileged account is named
Test1, you cannot name a standard accounttest1.The name cannot be a reserved keyword.
Account Type
Select Privileged Account.
New Password
Set 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.
The allowed special characters are
!@#$%^&*()_+-=.
NoteKeep your password secure. If you forget the password, you can reset it.
ApsaraDB RDS for MySQL 5.7 and 8.0 instances support custom password policies to improve security for database access.
Confirm Password
Enter the password again.
Description
Enter a description to help you manage the account. The description can be up to 256 characters in length and cannot contain
http://orhttps://.Click OK.
Reset account permissions
If an issue occurs with the privileged account, such as you accidentally revoke permissions (REVOKE) from the privileged account, you can restore its permissions by resetting them.
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.
In the left-side navigation pane, click Accounts.
To the right of the Privileged Account, click Reset Account Permissions.
Enter the password of the privileged account and click OK to reset the permissions.
Create a standard account
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.
In the left-side navigation pane, click Accounts.
Click Create Account.
Configure the following parameters.
Parameter
Description
Database Account
Enter a name for the account. The name must meet the following requirements:
The account name must be 2 to 16 characters in length for MySQL 5.6, and 2 to 32 characters in length for MySQL 8.0 and MySQL 5.7.
It must consist of letters, digits, and underscores (_).
It must start with a letter and end with a letter or digit.
The name must be unique within the instance.
The name of a standard account cannot be similar to the name of the privileged account. For example, if the privileged account is named
Test1, you cannot name a standard accounttest1.The name cannot be a reserved keyword.
Account Type
Select Standard Account.
Authorize Database:
Grant permissions on one or more databases to the account. You can leave this parameter empty and grant permissions after you create the account.
Select one or more databases from the left panel and click the > icon to add them to the right panel.
In the right panel, select a permission level for each database: Read/Write (DDL + DML), Read-Only, DDL Only, or DML Only.
To grant the same permissions to multiple databases, click the permission level you want next to Set All to in the upper-right corner of the right panel.
NoteFor details about each permission, see List of account permissions.
New Password
Set 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.
The allowed special characters are
!@#$%^&*()_+-=.
NoteKeep your password secure. If you forget the password, you can reset it.
ApsaraDB RDS for MySQL 5.7 and 8.0 instances support custom password policies to improve security for database access.
Confirm Password
Enter the password again.
Description
Enter a description to help you manage the account. The description can be up to 256 characters in length and cannot contain
http://orhttps://.Click OK.
API reference
Call the CreateAccount operation to create a database account.