Section courante

A propos

Section administrative du site

ALTER USER

Modifie l'utilisateur
MySQL

Syntaxe

ALTER USER [IF EXISTS]
   user [auth_option] [, user [auth_option]] ...
   [REQUIRE {NONE | tls_option [[AND] tls_option] ...}]
   [WITH resource_option [resource_option] ...]
   [password_option | lock_option] ...
   [COMMENT 'comment_string' | ATTRIBUTE 'json_object']
ALTER USER [IF EXISTS] USER() user_func_auth_option
ALTER USER [IF EXISTS]
   user DEFAULT ROLE
   {NONE | ALL | role [, role ] ...}
auth_option: {
   IDENTIFIED BY 'auth_string'
      [REPLACE 'current_auth_string']
      [RETAIN CURRENT PASSWORD]
   | IDENTIFIED BY RANDOM PASSWORD
      [REPLACE 'current_auth_string']
      [RETAIN CURRENT PASSWORD]
   | IDENTIFIED WITH auth_plugin
   | IDENTIFIED WITH auth_plugin BY 'auth_string'
      [REPLACE 'current_auth_string']
      [RETAIN CURRENT PASSWORD]
   | IDENTIFIED WITH auth_plugin BY RANDOM PASSWORD
      [REPLACE 'current_auth_string']
      [RETAIN CURRENT PASSWORD]
   | IDENTIFIED WITH auth_plugin AS 'auth_string'
   | DISCARD OLD PASSWORD
}

user_func_auth_option: {
   IDENTIFIED BY 'auth_string'
      [REPLACE 'current_auth_string']
      [RETAIN CURRENT PASSWORD]
   | DISCARD OLD PASSWORD
}

tls_option: {
   SSL
   | X509
   | CIPHER 'cipher'
   | ISSUER 'issuer'
   | SUBJECT 'subject'
}

resource_option: {
   MAX_QUERIES_PER_HOUR count
   | MAX_UPDATES_PER_HOUR count
   | MAX_CONNECTIONS_PER_HOUR count
   | MAX_USER_CONNECTIONS count
}

password_option: {
   PASSWORD EXPIRE [DEFAULT | NEVER | INTERVAL N DAY]
   | PASSWORD HISTORY {DEFAULT | N}
   | PASSWORD REUSE INTERVAL {DEFAULT | N DAY}
   | PASSWORD REQUIRE CURRENT [DEFAULT | OPTIONAL]
   | FAILED_LOGIN_ATTEMPTS N
   | PASSWORD_LOCK_TIME {N | UNBOUNDED}
}

lock_option: {
   ACCOUNT LOCK
   | ACCOUNT UNLOCK
}

Description

Cette instruction permet de modifier un compte MySQL existant.



Dernière mise à jour : Mardi, le 31 Août 2021