In MySQL 8, there is one new feature that is well worth a special mention. Right on the MySQL server, you can now create roles, specify their privileges, and assign them to users. So, from now on, it will be an easy task for you because you will not need to remember which permissions a team X programmer needs, and whether a team QA must have Z privileges, and so on.
Let's take a concrete example:
To create a role, just run following command:
CREATE ROLE 'devops_developer', 'app_read', 'app_write';
Now give privileges to the role:
GRANT SELECT ON app_db.* TO 'app_read';
And, finally, share this role with a user:
GRANT 'app_read' TO 'read_username1'@'localhost', 'read_username2'@'localhost';
The other options available are as follows:
- Mandatory...