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
Line 5: Line 5:
 
* [https://mariadb.com/kb/en/alter-user/ MariaDB Knowledge Base]
 
* [https://mariadb.com/kb/en/alter-user/ MariaDB Knowledge Base]
 
==Syntax==
 
==Syntax==
'''Note''': The following is incomplete.
+
'''Note''': The table below is incomplete.
  
 
<code>ALTER USER</code> [<code>IF EXISTS</code>]
 
<code>ALTER USER</code> [<code>IF EXISTS</code>]
Line 51: Line 51:
 
==Example==
 
==Example==
 
* <syntaxhighlight inline lang=SQL>ALTER USER 'rc-bot'@localhost IDENTIFIED BY 'YourPassword!';</syntaxhighlight>
 
* <syntaxhighlight inline lang=SQL>ALTER USER 'rc-bot'@localhost IDENTIFIED BY 'YourPassword!';</syntaxhighlight>
**  Note that the syntax
 

Revision as of 03:19, 17 February 2025

"ALTER" SQL statement

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 –
  • 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>')

Example

  • ALTER USER 'rc-bot'@localhost IDENTIFIED BY 'YourPassword!';