Document Database Service

Creating an Instance Account

2025-07-16 03:14:41

In the DDS, you can create a user account using several methods. Here, creating a user account using the shell command and creating a user account in the management console are taken as an example.

Creating a User Account Using the Shell Command

Procedure

1. Connect to the instance using the shell command. For more information, see the tutorial in DDS - Getting Started - Connecting to DDS Instance.

2. Select the admin database.

use admin

3. For example, to create a testUser user, enter the following user creation command in shell.

db.createUser({user: "testUser", pwd: "*********", passwordDigestor:"server", roles:[{role: "root", db: "admin"}]})
  • user: Enter the name of the user you want to create.

  • pwd: Enter the user password.

  • passwordDigestor: Enter the fixed value.

  • roles: Enter the user role.

4. Check whether the user is successfully created. If the command output is as follows, the user is created successfully.

Successfully added user: {
        "user" : "testUser",
        "passwordDigestor" : "server",
        "roles" : [
                {
                        "role" : "root",
                        "db" : "admin"
                }
        ]
}

Creating a User Account in the Console

Procedure

  1. Go to the DDS Management Console.

  2. Select the instance for which you want to create an account and click Account Management.

  3. Click Create Account and enter necessary information as instructed. Click OK. The account is created.

Description

  • Account name: Specifies the username of the account you created.

  • Authentication database: Sets the authentication database of the account. The default value is admin.

  • Password: Specifies the password of the account you created.

  • Assign permission: Selects specific permissions assigned to a specific database and adds permission by using the Add Permissions option.


Xp9_RWjSH2_s