This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-14. For the latest, interactive version please visit https://mariadb.com/kb/.

DROP ROLE

MariaDB starting with 10.0.5

I ruoli sono stati introdotti in MariaDB 10.0.5.

Sintassi

DROP ROLE [IF EXISTS] ruolo [,ruolo ...]

Spiegazione

L'istruzione DROP ROLE rimuove uno o più ruoli da MariaDB. Per utilizzarla, occorre disporre del privilegio globale CREATE USER o del privilegio DELETE sul database mysql.

Se uno degli account specificati non esiste, si ottiene un ERROR 1396 (HY000). Se si verifica un errore, DROP ROLE elimina i ruoli che non causano un errore.

IF EXISTS serve ad evitare che venga generato un errore se il role non esiste.

Esempio

DROP ROLE journalist;

IF EXISTS:

DROP ROLE journalist;
ERROR 1396 (HY000): Operation DROP ROLE failed for 'journalist'

DROP ROLE IF EXISTS journalist;
Query OK, 0 rows affected, 1 warning (0.00 sec)

Note (Code 1975): Can't drop role 'journalist'; it doesn't exist
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.