📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

CREATE PASSWORD POLICY



Creates a new password policy in TiDB Cloud Lake.

Syntax

CREATE [ OR REPLACE ] PASSWORD POLICY [ IF NOT EXISTS ] <policy_name> [ PASSWORD_MIN_LENGTH = <number> ] [ PASSWORD_MAX_LENGTH = <number> ] [ PASSWORD_MIN_UPPER_CASE_CHARS = <number> ] [ PASSWORD_MIN_LOWER_CASE_CHARS = <number> ] [ PASSWORD_MIN_NUMERIC_CHARS = <number> ] [ PASSWORD_MIN_SPECIAL_CHARS = <number> ] [ PASSWORD_MIN_AGE_DAYS = <number> ] [ PASSWORD_MAX_AGE_DAYS = <number> ] [ PASSWORD_MAX_RETRIES = <number> ] [ PASSWORD_LOCKOUT_TIME_MINS = <number> ] [ PASSWORD_HISTORY = <number> ] [ COMMENT = '<comment>' ]

Password Policy Attributes

This table summarizes essential parameters for a password policy, covering aspects like length, character requirements, age restrictions, retry limits, lockout duration, and password history:

AttributeMinMaxDefaultDescription
PASSWORD_MIN_LENGTH82568Minimum length of the password
PASSWORD_MAX_LENGTH8256256Maximum length of the password
PASSWORD_MIN_UPPER_CASE_CHARS02561Minimum number of uppercase characters in the password
PASSWORD_MIN_LOWER_CASE_CHARS02561Minimum number of lowercase characters in the password
PASSWORD_MIN_NUMERIC_CHARS02561Minimum number of numeric characters in the password
PASSWORD_MIN_SPECIAL_CHARS02560Minimum number of special characters in the password
PASSWORD_MIN_AGE_DAYS09990Minimum number of days before password can be modified (0 indicates no restriction)
PASSWORD_MAX_AGE_DAYS099990Maximum number of days before password must be modified (0 indicates no restriction)
PASSWORD_MAX_RETRIES1105Maximum number of password retries before lockout
PASSWORD_LOCKOUT_TIME_MINS199915Duration of lockout in minutes after exceeding retries
PASSWORD_HISTORY0240Number of recent passwords to check for duplication (0 indicates no restriction)

Examples

This example creates a password policy named 'SecureLogin' with a minimum password length requirement set to 10 characters:

CREATE PASSWORD POLICY SecureLogin PASSWORD_MIN_LENGTH = 10;

Was this page helpful?