ALTER USER
On this page
Alters settings associated with the user.
Syntax
ALTER USER user[@host] [IDENTIFIED BY 'password'] [ACCOUNT UNLOCK]
[SET [DEFAULT RESOURCE POOL = poolname] [FAILED_LOGIN_ATTEMPTS = integer] [PASSWORD_LOCK_TIME = integer]]
[REQUIRE {SSL | NONE}]
Arguments
-
user: The name of the user.
-
host: The host that the user can connect from.
For example, specifying localhost
means the user account can be used only when connecting from the local host.If no host is explicitly specified, the %
wildcard will be used, which lets the user connect from any host. -
password: An optional database connection password.
-
poolname: The new default resource pool.
-
ACCOUNT UNLOCK: Unlocks an account that has been locked out due to exceeding the failed login attempts limit.
-
FAILED_
LOGIN_ ATTEMPTS: Together with PASSWORD_
, specifies the failed login attempt lockout behavior.LOCK_ TIME FAILED_
is the number of failed attempts allowed before the account is locked out.LOGIN_ ATTEMPTS Default is 0
which means there is no restriction.When set to a value >=1, PASSWORD_
must also be specified.LOCK_ TIME -
PASSWORD_
LOCK_ TIME: Together with FAILED_
, specifies the failed login attempt lockout behavior.LOGIN_ ATTEMPTS PASSWORD_
is the number of seconds a locked out account must wait before reattempting to log in.LOCK_ TIME -
REQUIRE:
SSL
option ensures that the user connects via SSL.NONE
specifies that SSL will not be required for the connection.
For more information about failed login attempt lockout behavior, see SingleStore User Management.
Remarks
-
Users must have
GRANT
permission to execute theALTER USER
command. -
This command causes implicit commits.
Refer to COMMIT for more information. -
Refer to the Permission Matrix for the required permission.
Examples
The following example demonstrates how to add a new user with a resource pool, and then change the resource pool.
CREATE USER joe WITH DEFAULT RESOURCE POOL = general;ALTER USER joe SET DEFAULT RESOURCE POOL = executive;ALTER USER joe ACCOUNT UNLOCK;
The following example requires SSL on the user db_
ALTER USER 'db_mgr'@'localhost' REQUIRE SSL;
Last modified: June 27, 2024