AnalyticDB for MySQL allows you to execute the CREATE USER statement to create a database account.

CREATE USER
    [if not exists] user [auth_option] [, [if not exists] user [auth_option]] ...      

Precautions

  • To create a database account by executing the CREATE USER statement, you must have the CREATE_USER permission.
  • The password of a database account must meet the following requirements:
    • The password is 8 to 32 characters in length.
    • The password contains at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. These special characters include ! @ # $ % ^ & * ( ) _ + - = .

Examples

Create an account named account2 and set the password to Account2.

CREATE USER if not exists 'account2' IDENTIFIED BY 'Account2';