Updated on 2024-02-08 GMT+08:00

Managing Accounts

Scenarios

GeminiDB Redis API provides the enterprise-grade multi-tenant capability. You can add read-only or read/write accounts in your instance to control access to each database to avoid misoperations on data of other tenants. This section describes how to manage accounts.

Precautions

  • A maximum of 200 accounts can be created for each GeminiDB Redis instance.
  • Account change takes effect 10 seconds later after it is performed.
  • If you use a backup to restore data to a new instance, the account information of the original instance will not be inherited.
  • The account to be created must meet the requirements in Table 1.
    Table 1 Parameter requirements

    Parameter

    Requirement

    Example Value

    Account Name

    • Cannot be left blank.
    • Can contain a maximum of 36 characters.
    • Must start with a letter and can contain only digits, letters, underscores (_), and hyphens (-).

    Organization

    Permission

    • Read/Write
    • Read-only

    Read/Write

    Database

    • Authorize all databases
    • Unauthorized
    • Authorized
      NOTE:
      • You can add a database on the right of Database as required.
      • You can select the databases to be authorized as required.
      • Database refers to the DB of the open-source Redis.

    Authorize all databases

    Password

    • Cannot be left blank.
    • Can include 8 to 32 characters.
    • Must contain at least two of the following types: uppercase letters, lowercase letters, digits, and special characters. The following special characters are allowed: ~!@#%^*-_=+?$()&

    nosql123456

Creating an Account

  1. Log in to the management console.
  2. In the service list, choose Databases > GeminiDB Redis API.
  3. In the instance list, select an instance and click its name to go to the Basic Information page.
  4. In the navigation pane on the left, choose Accounts.
  5. On the displayed page, click Create Account.

    Figure 1 Creating an account

  6. In the displayed dialog box, enter a username, select permissions for databases, authorize required databases (DBs), enter a password, confirm the password, and click OK.

    Figure 2 Configuring required parameters

  7. View and manage the created account in the account list.

Resetting a Password

  1. Log in to the management console.
  2. In the service list, choose Databases > GeminiDB Redis API.
  3. In the instance list, locate the target instance and click its name to go to the Basic Information page.
  4. In the navigation pane on the left, choose Accounts.
  5. On the displayed page, select the account whose password needs to be reset and click Reset Password.

    Figure 3 Resetting a password

  6. In the displayed dialog box, enter a new password, confirm the password, and click OK.

    Figure 4 Resetting a password

  7. Run auth USER PWD or auth USER:PWD to log in to the instance again.

Changing Permissions of an Account

  1. Log in to the management console.
  2. In the service list, choose Databases > GeminiDB Redis API.
  3. In the instance list, locate the target instance and click its name to go to the Basic Information page.
  4. In the navigation pane on the left, choose Accounts.
  5. On the displayed page, select the account whose permissions need to be modified and click Change Permission.

    Figure 5 Changing permissions

  6. In the displayed dialog box, select the required permissions and database, and click OK.

    Figure 6 Changing permissions

  7. Run auth USER PWD or auth USER:PWD to log in to the instance again.

Deleting an Account

  1. Log in to the management console.
  2. In the service list, choose Databases > GeminiDB Redis API.
  3. In the instance list, locate the target instance and click its name to go to the Basic Information page.
  4. In the navigation pane on the left, choose Accounts.
  5. On the displayed page, locate the account that you want to delete and click Delete. In the displayed dialog box, click OK.

    Figure 7 Deleting an account

  6. Verify that the deleted account is no longer displayed.

How to Use a New Account to Access a Database

  1. Access the database by running auth USER PWD or auth USER:PWD.
  2. When you access the database using an SDK on your application, use the value of USER and PWD as the username and password, or use USER:PWD as the password parameter.

    When you access the database by running auth argc , ensure that argc does not contain colons. If an incorrect password contains colons, the returned value is the same as that of auth argc1 argc2.