Updated on 2024-11-06 GMT+08:00

Creating an Account

Scenarios

When you create a GaussDB(for MySQL) instance, account root is created by default. You can create other accounts as needed.

Constraints

This operation is not allowed when another operation is being performed on your DB instance.

Method 1: Creating an Account on the GaussDB(for MySQL) Console

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and project.
  3. Click in the upper left corner of the page and choose Databases > GaussDB(for MySQL).
  4. On the Instances page, click the instance name.
  5. In the navigation pane, choose Accounts.
  6. On the displayed page, click Create Account.
  7. In the displayed dialog box, set the required parameters.

    Figure 1 Creating an account

    Table 1 Parameter description

    Parameter

    Description

    Username

    The username can consist of 1 to 32 characters. Only letters, digits, and underscores (_) are allowed.

    Host IP Address

    • To enable all IP addresses to access your DB instance, set it to %.
    • To enable all IP addresses in the subnet 10.10.10.* to access your DB instance, set it to 10.10.10.%.
    • To specify multiple IP addresses, separate them with commas (,), for example, 192.168.0.*,172.16.213.* (no spaces before or after the comma).

    Database

    You can select one or more unauthorized databases and authorize their permissions to the account. If there are no unauthorized databases, you can create ones. You can also modify the database permissions after the account is created.
    NOTE:
    • If you do not delete a database on the GaussDB(for MySQL) console but delete a database in other ways, permissions granted specifically for the database are not automatically deleted. They must be deleted manually. This is an open-source MySQL behavior. For details, see DROP DATABASE Statement.
    • If you require fine-grained permissions control, log in to the DAS console.

    Password

    The password must:

    • Consist of 8 to 32 characters.
    • Contain at least three types of the following characters: uppercase letters, lowercase letters, digits, and special characters (~!@#$%^*-_=+?,()&|.).
    • Comply with the values of validate_password parameters.
      To check the password-related parameter values, click an instance name, choose Parameters in the navigation pane, and search for validate_password in the upper right corner of the page.
      Figure 2 Checking the password-related parameters
    • Be different from the username or the username spelled backwards.

    Confirm Password

    The value must be the same as that of Password.

    Remarks

    The remarks can consist of up to 512 characters. It cannot contain carriage returns or any of the following special characters: !<"='>&

  8. Click OK.
  9. After the account is created, you can manage it on the Accounts page of the selected instance.

Method 2: Creating an Account Through DAS

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and project.
  3. Click in the upper left corner of the page and choose Databases > GaussDB(for MySQL).
  4. On the Instances page, locate an instance and click Log In in the Operation column.
  5. On the displayed DAS login page, enter the username and password and click Log In.
  6. Create an account using either of the following methods:

    • Choose SQL Operations > SQL Query. In the displayed SQL window, select the target database and run the following command:
      create user username;
    • Choose Account Management > User Management and click Create User.

      For detailed operations and parameter settings, see Creating a User.