Difference between revisions of "MariaDB/SQL/GRANT"
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
|  (Created page with "==Syntax== * <code>GRANT</code> {{fmt/arg|priv list}} <code>ON</code> {{fmt/arg|object type}} {{fmt/arg|priv level}} <code>TO</code> {{fmt/arg|user spec}} [ {{fmt/arg|user opt...") | |||
| Line 1: | Line 1: | ||
| + | ==Related== | ||
| + | * <code>{{l/same|REVOKE}}</code> negates privileges granted by <code>GRANT</code>. | ||
| + | * <code>{{l/same|SHOW GRANTS}}</code> lists privileges granted by <code>GRANT</code>. (see <code>{{l/same|SHOW}}</code>) | ||
| ==Syntax== | ==Syntax== | ||
| * <code>GRANT</code> {{fmt/arg|priv list}} <code>ON</code> {{fmt/arg|object type}} {{fmt/arg|priv level}} <code>TO</code> {{fmt/arg|user spec}} [ {{fmt/arg|user options}} ] | * <code>GRANT</code> {{fmt/arg|priv list}} <code>ON</code> {{fmt/arg|object type}} {{fmt/arg|priv level}} <code>TO</code> {{fmt/arg|user spec}} [ {{fmt/arg|user options}} ] | ||
| ** '''{{fmt/arg|priv list}}''': {{fmt/arg|priv_type}} {{fmt/arg/opt|column_list}} [, ''repeat...''] | ** '''{{fmt/arg|priv list}}''': {{fmt/arg|priv_type}} {{fmt/arg/opt|column_list}} [, ''repeat...''] | ||
| + | ** '''{{fmt/arg|priv_type}}''': ''one of –'' | ||
| + | *** <code>USAGE</code> | ||
| + | *** <code>ALL</code> [<code>PRIVILEGES</code>] | ||
| + | *** <code>GRANT OPTION</code> | ||
| ** '''{{fmt/arg|object type}}''': ''one of –'' | ** '''{{fmt/arg|object type}}''': ''one of –'' | ||
| *** <code>TABLE</code> | *** <code>TABLE</code> | ||
Revision as of 18:02, 16 February 2025
Related
- REVOKEnegates privileges granted by- GRANT.
- SHOW GRANTSlists privileges granted by- GRANT. (see- SHOW)
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]
- GRANT OPTION
 
- <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...]
 
 
- GRANT<rolename>- TO<grantee> [, repeat...] [- WITH ADMIN OPTION]- <grantee>: one of –
- <rolename>
- <username> [ <authentication option> ]
 
 
- <grantee>: one of –