SET DEFAULT ROLE
This page is part of MariaDB's Documentation.
The parent of this page is: SQL Statements for MariaDB Xpand
Topics on this page:
Overview
In 23.09, 6.1:
Sets the default role for the specified user.
In 6.1:
Sets the default role for the specified user.
In 6.0, 5.3:
Not present
See also: SQL Statements for MariaDB Xpand 23.09, in 6.1, in 6.0, and in 5.3
See also: SQL Statements for MariaDB Xpand 6.1
USAGE
Common Syntax:
SET DEFAULT ROLE (ALL | NONE | <role_name> [, <role_name>] ...)
[FOR USER <user_name>]
DETAILS
This statement sets the default role for the specified user. This role must exist and must be granted to the user first.
For Xpand, all objects are case-insensitive.
EXAMPLES
SET DEFAULT ROLE
To set the default role for a user:
SET DEFAULT ROLE role1 FOR user1;
To check the default role set for a user:
SHOW GRANTS FOR user1;
+------------------------------------------+
| Grants for user1@% |
+------------------------------------------+
| GRANT USAGE ON *.* TO 'user1'@'%' |
| GRANT `role1` TO 'user1'@'%' |
| SET DEFAULT ROLE `role1` FOR 'user1'@'%' |
+------------------------------------------+
ALL
To activate all of a user's roles by default, set the default role to ALL
:
SET DEFAULT ROLE ALL FOR user1;
NONE
To remove all of a user's default roles, set the default role to NONE
:
SET DEFAULT ROLE NONE FOR user1;
RELATED TOPICS
CHANGE HISTORY
Release Series | History |
---|---|
23.09 |
|
6.1 |
|
6.0 |
|
5.3 |
|
Release Series | History |
---|---|
6.1 |
|