All Products
Search
Document Center

PolarDB:Manage account passwords

Last Updated:Mar 28, 2026

PolarDB for MySQL on ENS (edge clusters) lets you change account passwords, set password expiration policies, and control password strength validation—all from the console or command line.

Prerequisites

Before you begin, ensure that you have:

  • A PolarDB for MySQL edge cluster

  • A privileged account (required for command-line operations and password expiration settings)

Limitations

FeatureMySQL 5.6MySQL 5.7MySQL 8.0
Change password (console)SupportedSupportedSupported
Change password (command line)SupportedSupportedSupported
Set password expirationNot supportedSupportedSupported
validate_password pluginNot supportedSupportedSupported

Change account passwords

Warning

After you change an account password, the old password can no longer be used to access the cluster.

Console

  1. Go to the PolarDB console for ENS. In the Cluster List, click the ID of the target cluster.

  2. In the left navigation pane, choose Configuration and Management > Account Management.

  3. Find the account and click Change Password in the Actions column.

  4. In the Change Password dialog box, enter a new password in the New Password and Confirm New Password fields, then click OK.

Command line

Only a privileged account can change passwords from the command line.

MySQL 8.0

ALTER USER 'username'@'host' IDENTIFIED BY 'password';
ParameterDescription
usernameThe account whose password you want to change
hostThe host from which the account can log in. Use % to allow login from any host
passwordThe new password for the account

MySQL 5.6 and MySQL 5.7

SET PASSWORD FOR 'username'@'host' = PASSWORD('password');
ParameterDescription
usernameThe account whose password you want to change
hostThe host from which the account can log in. Use % to allow login from any host
passwordThe new password for the account

Set password expiration

Password expiration can only be configured from the command line using a privileged account. MySQL 5.6 does not support this feature.

  1. Connect to the database using a privileged account. See Connect to a PolarDB for MySQL edge cluster.

  2. Run the following SQL statement:

    ALTER USER 'username'@'hostname' PASSWORD EXPIRE INTERVAL N DAY;
    ParameterDescription
    usernameThe account to configure
    hostnameThe hostname for the account
    NThe password validity period in days

Enable or disable password validation

The validate_password plugin enforces password strength policies. Install it to enable validation, or uninstall it to disable validation. MySQL 5.6 does not support this feature.

validate_password parameters cannot be modified in the console. Use the command line to modify these parameters.
  1. Connect to the database using a privileged account. See Connect to a PolarDB for MySQL edge cluster.

  2. Install validate_password to enable password validation:

    MySQL 8.0

    INSTALL COMPONENT 'file://component_validate_password';

    MySQL 5.7

    INSTALL PLUGIN validate_password SONAME 'validate_password.so';
  3. (Optional) Uninstall validate_password to disable password validation:

    MySQL 8.0

    UNINSTALL COMPONENT 'file://component_validate_password';

    MySQL 5.7

    UNINSTALL PLUGIN validate_password;