Difference between revisions of "MariaDB/SQL/GRANT"

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 8: Line 8:
 
*** <code>USAGE</code>
 
*** <code>USAGE</code>
 
*** <code>ALL</code> [<code>PRIVILEGES</code>]
 
*** <code>ALL</code> [<code>PRIVILEGES</code>]
*** <code>GRANT OPTION</code>
 
 
** '''{{fmt/arg|object type}}''': ''one of &ndash;''
 
** '''{{fmt/arg|object type}}''': ''one of &ndash;''
 
*** <code>TABLE</code>
 
*** <code>TABLE</code>
Line 25: Line 24:
 
*** {{fmt/arg|username}} {{fmt/arg/opt|authentication option}}
 
*** {{fmt/arg|username}} {{fmt/arg/opt|authentication option}}
 
*** <code>PUBLIC</code>
 
*** <code>PUBLIC</code>
** '''{{fmt/arg/opt|authentication option}}''': ''one of &ndash;''
+
** '''{{fmt/arg|authentication option}}''': ''one of &ndash;''
 
*** <code>IDENTIFIED BY</code> '{{fmt/arg|password}}'  
 
*** <code>IDENTIFIED BY</code> '{{fmt/arg|password}}'  
 
*** <code>IDENTIFIED BY PASSWORD</code> 'password_hash'
 
*** <code>IDENTIFIED BY PASSWORD</code> 'password_hash'
 
*** <code>IDENTIFIED</code> {<code>VIA</code>|<code>WITH</code>} {{fmt/arg|authentication rule}} [OR ''repeat...'']
 
*** <code>IDENTIFIED</code> {<code>VIA</code>|<code>WITH</code>} {{fmt/arg|authentication rule}} [OR ''repeat...'']
 +
** '''{{fmt/arg|user option}}''':  ''one of &ndash;''
 +
*** <code>REQUIRE</code> {<code>NONE</code> | {{fmt/arg|TLS option}} [[<code>AND</code>] ''repeat...'']
 +
*** [<code>WITH</code> {{fmt/arg|with option}} [''repeat...'']
 +
** '''{{fmt/arg|with option}}''': ''one of &ndash;''
 +
*** <code>GRANT OPTION</code>
 +
*** {{fmt/arg|resource_option}}
 
* <code>GRANT</code> {{fmt/arg|rolename}} <code>TO</code> {{fmt/arg|grantee}} [, ''repeat...''] [<code>WITH ADMIN OPTION</code>]
 
* <code>GRANT</code> {{fmt/arg|rolename}} <code>TO</code> {{fmt/arg|grantee}} [, ''repeat...''] [<code>WITH ADMIN OPTION</code>]
 
** '''{{fmt/arg|grantee}}''': ''one of &ndash;''
 
** '''{{fmt/arg|grantee}}''': ''one of &ndash;''
 
*** {{fmt/arg|rolename}}
 
*** {{fmt/arg|rolename}}
 
*** {{fmt/arg|username}} {{fmt/arg/opt|authentication option}}
 
*** {{fmt/arg|username}} {{fmt/arg/opt|authentication option}}

Revision as of 18:08, 16 February 2025

Related

Syntax

  • GRANT <priv list> ON <object type> <priv level> TO <user spec> [ <user options> ]
    • <priv list>: <priv_type> [ <column_list> ] [, repeat...]
    • <priv_type>: one of –
      • USAGE
      • ALL [PRIVILEGES]
    • <object type>: one of –
      • TABLE
      • FUNCTION
      • PROCEDURE
      • PACKAGE
      • PACKAGE BODY
    • <priv level>: one of –
      • *
      • *.*
      • <db_name>.*
      • <db_name>.<tbl_name>
      • <tbl_name>
      • <db_name>.<routine_name>
    • <user spec>: one of –
      • <username> [ <authentication option> ]
      • PUBLIC
    • <authentication option>: one of –
      • IDENTIFIED BY '<password>'
      • IDENTIFIED BY PASSWORD 'password_hash'
      • IDENTIFIED {VIA|WITH} <authentication rule> [OR repeat...]
    • <user option>: one of –
      • REQUIRE {NONE | <TLS option> [[AND] repeat...]
      • [WITH <with option> [repeat...]
    • <with option>: one of –
      • GRANT OPTION
      • <resource_option>
  • GRANT <rolename> TO <grantee> [, repeat...] [WITH ADMIN OPTION]
    • <grantee>: one of –
      • <rolename>
      • <username> [ <authentication option> ]