MySQL 8.0 Roles and Graphml

You may already know that MySQL 8.0 is coming with a nice requested feature : ROLES

A role is a named collection of privileges. When you watch some slidedeck about MySQL 8.0 and ROLES, some times you can see a graph illustrating the ROLES and their eventual hierarchy. From the documentation, it seems those graphs are made using the ROLES_GRAPHML() function.

5 thoughts on “MySQL 8.0 Roles and Graphml”

However in MariaDB they are. The difference between the 2 is that in MariaDB the mysql.user table has a column `is_role`. Due to this it is possible for clients to distingusih roles and plain users in MariaDB, but not in MySQL.

[27 Mar 2017 12:37] Kristofer Pettersson
Both roles and users are in fact authorization identifiers and share the same namespace per design.

A role is functionally a role when it’s present in role_edges. Any authorization identifier can be a role and any user can be a role (ie you can authenticate to any authorization identifier unless it’s locked or otherwise restricted)

There’s no artificial restriction embedded in the system to prevent this but you are free to do as you please.

As a DBA you might still have a personal intention that a specific authorization identifier must be a role, and then using a name scheme to communicate this intention is in fact not a bad choice. You can for example add a prefix “r_” to those authorization IDs which you intend to be roles and nothing else.