Roles have been existing on many RDBMS for a long time by now.
Starting from version 8.0, this functionality is finally there
for MySQL.
The most important advantage is to define only once a role that
includes a “set of permissions”, then assign it to each user,
avoiding wasting time declaring them individually.
In MySQL, a role can be created like a user, but without the “identified by” clause and without login:
mysqld2-(root@localhost) [(none)]> CREATE ROLE 'r_sakila_read'; Query OK, 0 rows affected (0.03 sec) mysqld2-(root@localhost) [(none)]> select user,host,authentication_string from mysql.user; +------------------+-----------+------------------------------------------------------------------------+ | user | host | authentication_string | +------------------+-----------+------------------------------------------------------------------------+ | …[Read more]