Difference between revisions of "MariaDB/SQL/ALTER"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< MariaDB‎ | SQL
Jump to navigation Jump to search
(Created page with "==Related== * This modifies users created by {{l/same|CREATE}}. ==Syntax== <code>ALTER USER</code> [<code>IF EXISTS</code>] {{fmt/arg|user spec}} [, ''repeat...''] [<code>REQU...")
 
Line 1: Line 1:
 +
{{fmt/title|"ALTER" SQL statement}}
 
==Related==
 
==Related==
 
* This modifies users created by {{l/same|CREATE}}.
 
* This modifies users created by {{l/same|CREATE}}.
 
==Syntax==
 
==Syntax==
<code>ALTER USER</code> [<code>IF EXISTS</code>] {{fmt/arg|user spec}} [, ''repeat...''] [<code>REQUIRE</code> {<code>NONE</code> | {{fmt/arg|TLS option}} [[<code>AND</code>] ''repeat...'']} [<code>WITH</code> {{fmt/arg|resource option}} [''repeat...'']] {{fmt/arg/opt|lock option}} {{fmt/arg/opt|password option}}
+
<code>ALTER USER</code> [<code>IF EXISTS</code>]
* '''{{fmt/arg|user spec}}''': {{fmt/arg|username}} {{fmt/arg/opt|authentication option}}
+
: {{fmt/arg|user spec}} [, ''repeat...'']
* '''{{fmt/arg|TLS option}}''': ''one of &ndash;''
+
: [<code>REQUIRE</code> {<code>NONE</code> | {{fmt/arg|TLS option}} [[<code>AND</code>] ''repeat...'']}]
** <code>IDENTIFIED BY</code> '{{fmt/arg|password}}'
+
: [<code>WITH</code> {{fmt/arg|resource option}} [''repeat...'']]
** <code>IDENTIFIED BY PASSWORD</code> '{{fmt/arg|password hash}}'
+
: {{fmt/arg/opt|lock option}} {{fmt/arg/opt|password option}}
** <code>IDENTIFIED</code> {<code>VIA</code>|<code>WITH</code>} {{fmt/arg|authentication rule}} [<code>OR</code> ''repeat...'']
+
 
* '''{{fmt/arg|resource option}}''': ''one of &ndash;''
+
{| class="wikitable sortable"
** <code>MAX_QUERIES_PER_HOUR</code> {{fmt/arg|count}}
+
! argument name || value(s)
** <code>MAX_UPDATES_PER_HOUR</code> {{fmt/arg|count}}
+
|-
** <code>MAX_CONNECTIONS_PER_HOUR</code> {{fmt/arg|count}}
+
| valign=top | '''{{fmt/arg|user spec}}''' || {{fmt/arg|username}} {{fmt/arg/opt|authentication option}}
** <code>MAX_USER_CONNECTIONS</code> {{fmt/arg|count}}
+
|-
** <code>MAX_STATEMENT_TIME</code> {{fmt/arg|time}}
+
| valign=top | '''{{fmt/arg|TLS option}}''' || ''one of &ndash;''
* '''{{fmt/arg|lock option}}''': ''one of &ndash;''
+
* <code>IDENTIFIED BY</code> '{{fmt/arg|password}}'
** <code>ACCOUNT LOCK</code>
+
* <code>IDENTIFIED BY PASSWORD</code> '{{fmt/arg|password hash}}'
** <code>ACCOUNT UNLOCK</code>
+
* <code>IDENTIFIED</code> {<code>VIA</code>|<code>WITH</code>} {{fmt/arg|authentication rule}} [<code>OR</code> ''repeat...'']
* '''{{fmt/arg|password option}}''': ''one of &ndash;''
+
|-
** <code>PASSWORD EXPIRE</code>
+
| valign=top | '''{{fmt/arg|resource option}}''' || ''one of &ndash;''
** <code>PASSWORD EXPIRE DEFAULT</code>
+
* <code>MAX_QUERIES_PER_HOUR</code> {{fmt/arg|count}}
** <code>PASSWORD EXPIRE NEVER</code>
+
* <code>MAX_UPDATES_PER_HOUR</code> {{fmt/arg|count}}
** <code>PASSWORD EXPIRE INTERVAL N DAY</code>
+
* <code>MAX_CONNECTIONS_PER_HOUR</code> {{fmt/arg|count}}
* '''{{fmt/arg|authentication rule}}''': ''one of &ndash;''
+
* <code>MAX_USER_CONNECTIONS</code> {{fmt/arg|count}}
** {{fmt/arg|authentication plugin}}
+
* <code>MAX_STATEMENT_TIME</code> {{fmt/arg|time}}
** {{fmt/arg|authentication plugin}} {<code>USING</code>|<code>AS</code>} <code>'</code>{{fmt/arg|authentication string}}<code>'</code>
+
|-
** {{fmt/arg|authentication plugin}} {<code>USING</code>|<code>AS</code>} <code>PASSWORD('</code>{{fmt/arg|password}}<code>')</code>
+
| valign=top | '''{{fmt/arg|lock option}}''' || ''one of &ndash;''
* '''{{fmt/arg|authentication plugin}}''': ''one of &ndash;''
+
* <code>ACCOUNT LOCK</code>
** {{fmt/arg|authentication plugin}} {<code>USING</code>|<code>AS</code>} '{{fmt/arg|authentication string}}'
+
* <code>ACCOUNT UNLOCK</code>
** {{fmt/arg|authentication plugin}} {<code>USING</code>|<code>AS</code>} <code>PASSWORD('</code>{{fmt/arg|password}}<code>')</code>
+
|-
 +
| valign=top | '''{{fmt/arg|password option}}''' || ''one of &ndash;''
 +
* <code>PASSWORD EXPIRE</code>
 +
* <code>PASSWORD EXPIRE DEFAULT</code>
 +
* <code>PASSWORD EXPIRE NEVER</code>
 +
* <code>PASSWORD EXPIRE INTERVAL N DAY</code>
 +
|-
 +
| valign=top | '''{{fmt/arg|authentication rule}}''' || ''one of &ndash;''
 +
* {{fmt/arg|authentication plugin}}
 +
* {{fmt/arg|authentication plugin}} {<code>USING</code>|<code>AS</code>} <code>'</code>{{fmt/arg|authentication string}}<code>'</code>
 +
* {{fmt/arg|authentication plugin}} {<code>USING</code>|<code>AS</code>} <code>PASSWORD('</code>{{fmt/arg|password}}<code>')</code>
 +
|-
 +
| valign=top | '''{{fmt/arg|authentication plugin}}''' || ''one of &ndash;''
 +
* {{fmt/arg|authentication plugin}} {<code>USING</code>|<code>AS</code>} '{{fmt/arg|authentication string}}'
 +
* {{fmt/arg|authentication plugin}} {<code>USING</code>|<code>AS</code>} <code>PASSWORD('</code>{{fmt/arg|password}}<code>')</code>
 +
|}

Revision as of 03:03, 17 February 2025

"ALTER" SQL statement

Related

  • This modifies users created by CREATE.

Syntax

ALTER USER [IF EXISTS]

<user spec> [, repeat...]
[REQUIRE {NONE | <TLS option> [[AND] repeat...]}]
[WITH <resource option> [repeat...]]
[ <lock option> ] [ <password option> ]
argument name value(s)
<user spec> <username> [ <authentication option> ]
<TLS option> one of –
  • IDENTIFIED BY '<password>'
  • IDENTIFIED BY PASSWORD '<password hash>'
  • IDENTIFIED {VIA|WITH} <authentication rule> [OR repeat...]
<resource option> one of –
  • MAX_QUERIES_PER_HOUR <count>
  • MAX_UPDATES_PER_HOUR <count>
  • MAX_CONNECTIONS_PER_HOUR <count>
  • MAX_USER_CONNECTIONS <count>
  • MAX_STATEMENT_TIME <time>
<lock option> one of –
  • ACCOUNT LOCK
  • ACCOUNT UNLOCK
<password option> one of –
  • PASSWORD EXPIRE
  • PASSWORD EXPIRE DEFAULT
  • PASSWORD EXPIRE NEVER
  • PASSWORD EXPIRE INTERVAL N DAY
<authentication rule> one of –
  • <authentication plugin>
  • <authentication plugin> {USING|AS} '<authentication string>'
  • <authentication plugin> {USING|AS} PASSWORD('<password>')
<authentication plugin> one of –
  • <authentication plugin> {USING|AS} '<authentication string>'
  • <authentication plugin> {USING|AS} PASSWORD('<password>')