SET DEFAULT ROLE

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

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.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

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;

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Added in MariaDB Xpand 6.1.0.

6.0

  • Not present.

5.3

  • Not present.

Release Series

History

6.0

  • Not present.

5.3

  • Not present.

Release Series

History

6.1

  • Added in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES