Difference between revisions of "MariaDB/SQL/ALTER"
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...") |
m |
||
| (4 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
| + | {{fmt/title|"ALTER" SQL command}} | ||
==Related== | ==Related== | ||
* This modifies users created by {{l/same|CREATE}}. | * This modifies users created by {{l/same|CREATE}}. | ||
| + | ==Reference== | ||
| + | * [https://mariadb.com/kb/en/alter-user/ MariaDB Knowledge Base] | ||
==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}} | + | '''Note''': The table below is incomplete. |
| − | + | ||
| − | + | <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}} | |
| − | + | ||
| − | + | {| class="wikitable sortable" | |
| − | + | ! argument name || value(s) | |
| − | + | |- | |
| − | + | | valign=top | '''{{fmt/arg|user spec}}''' || {{fmt/arg|username}} {{fmt/arg/opt|auth option}} | |
| − | + | |- | |
| − | + | | valign=top | '''{{fmt/arg|auth option}}'''<br>(authentication option) || ''one of –'' | |
| − | + | * <code>IDENTIFIED BY '</code>{{fmt/arg|password}}<code>'</code> | |
| − | + | * <code>IDENTIFIED BY PASSWORD '</code>{{fmt/arg|password hash}}<code>'</code> | |
| − | + | * <code>IDENTIFIED</code> {<code>VIA</code>|<code>WITH</code>} {{fmt/arg|authentication rule}} [<code>OR</code> ''repeat...''] | |
| − | + | |- | |
| − | + | | valign=top | '''{{fmt/arg|resource option}}''' || ''one of –'' | |
| − | + | * <code>MAX_QUERIES_PER_HOUR</code> {{fmt/arg|count}} | |
| − | + | * <code>MAX_UPDATES_PER_HOUR</code> {{fmt/arg|count}} | |
| − | + | * <code>MAX_CONNECTIONS_PER_HOUR</code> {{fmt/arg|count}} | |
| − | + | * <code>MAX_USER_CONNECTIONS</code> {{fmt/arg|count}} | |
| − | + | * <code>MAX_STATEMENT_TIME</code> {{fmt/arg|time}} | |
| − | + | |- | |
| − | + | | valign=top | '''{{fmt/arg|lock option}}''' || ''one of –'' | |
| − | + | * <code>ACCOUNT LOCK</code> | |
| + | * <code>ACCOUNT UNLOCK</code> | ||
| + | |- | ||
| + | | valign=top | '''{{fmt/arg|password option}}''' || ''one of –'' | ||
| + | * <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 –'' | ||
| + | * {{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 –'' | ||
| + | * {{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> | ||
| + | |} | ||
| + | ==Example== | ||
| + | * <syntaxhighlight inline lang=SQL>ALTER USER 'rc-bot'@localhost IDENTIFIED BY 'YourPassword!';</syntaxhighlight> | ||
Latest revision as of 21:45, 18 February 2025
|
"ALTER" SQL command
|
Related
- This modifies users created by CREATE.
Reference
Syntax
Note: The table below is incomplete.
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> [ <auth option> ] |
| <auth option> (authentication option) |
one of –
|
| <resource option> | one of –
|
| <lock option> | one of –
|
| <password option> | one of –
|
| <authentication rule> | one of –
|
| <authentication plugin> | one of –
|
Example
ALTER USER 'rc-bot'@localhost IDENTIFIED BY 'YourPassword!';