ApsaraDB for Redis allows you to create multiple database accounts for an instance. You can grant permissions to these accounts based on the actual usage to manage your instance and minimize user errors.
Create an account
- Log on to the ApsaraDB for Redis console.
- On the top of the page, select the region where the instance is created.
- On the Instances page, find the instance that you want to manage, click the instance ID or Manage in the Actions column for the instance.
- In the left-side navigation pane, click Account Management.
Note If Account Management is not available for an instance of Redis 4.0 or later, you can try to upgrade the minor version of the instance. For more information, see Upgrade the minor version.
- On the Account Management page, click Create in the upper-right corner.
- In the Create Account dialog box that appears, set parameters as described in the following table and click
Table 1. Set account parameters Parameter Description Account Your account must meet the following requirements:
- The account name can contain lowercase letters, digits, underscores (_), and hyphens (-).
- The name must start with a lowercase letter.
- The name must be 1 to 16 characters in length.
Privilege The permissions granted to the account. Valid values: Read-only, Read/Write, and Replicate. If you select Replicate, you are authorized to use the SYNC and PSYNC commands after you connect to an instance with this account.Note You can create accounts that have the replicate permission only for standard instances of Redis 4.0 or later. Password Settings The password of your account must meet the following requirements:
- The password must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.
- The password must be 8 to 32 characters in length.
Confirm Password Enter the password again. Description The description of an account must meet the following requirements:
- The description can contain letters, Chinese characters, digits, underscores (_), and hyphens (-).
- The description must start with a letter or Chinese character,
- and cannot start with http:// or https://.
- The description must be 2 to 256 characters in length.
You can skip this parameter when you create an account.
Use an account
A database account is created for an instance. In the following example, the account created in the preceding procedure is used.
- Connect to an ApsaraDB for Redis instance.
- Run the auth account:password command to log on to the database.