All Products
Search
Document Center

AnalyticDB:CREATE USER

Last Updated:Mar 28, 2026

Creates a database account in AnalyticDB for MySQL.

CREATE USER
    [IF NOT EXISTS] user [auth_option] [, [IF NOT EXISTS] user [auth_option]] ...

Required permissions

To run CREATE USER, your account must have the CREATE_USER permission.

Password requirements

Passwords must meet all of the following requirements:

RequirementValue
Length8–32 characters
ComplexityAt least three of the following character types: uppercase letters, lowercase letters, digits, and special characters
Allowed special characters! @ # $ % ^ & * ( ) _ + - =

Example

Create an account named account2 with a password that satisfies the complexity requirements:

CREATE USER IF NOT EXISTS 'account2' IDENTIFIED BY 'Account2';