ALTER USER

    1. CREATE USER 'newuser' IDENTIFIED BY 'newuserpassword';
    1. Query OK, 1 row affected (0.01 sec)
    1. +----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    2. +----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    3. | CREATE USER 'newuser'@'%' IDENTIFIED WITH 'mysql_native_password' AS '*5806E04BBEE79E1899964C6A04D68BCA69B1A879' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK |
    4. +----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    5. 1 row in set (0.00 sec)
    1. ALTER USER 'newuser' IDENTIFIED BY 'newnewpassword';
    1. +----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    2. +----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    3. | CREATE USER 'newuser'@'%' IDENTIFIED WITH 'mysql_native_password' AS '*FB8A1EA1353E8775CA836233E367FBDFCB37BE73' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK |
    4. +----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    • 在 MySQL 中,ALTER 语句用于更改属性,例如使密码失效。但 TiDB 尚不支持此功能。