MySQL Forums
Forum List  »  Security

Re: In MySQL 8, how do you distinguish between Roles and Users in table mysql.user?
Posted by: Georgi Kodinov
Date: December 18, 2018 03:48AM

The question you want to answer first is why do you want to distinguish between a role and a user account.

If it's for display purposes (e.g. present the data in some UI tool etc) you can use Peter's definition (with a slight twist): a role is a user account with login disabled. This is what we document in RefMan too.

And yes, a role can be converted to a user account by enabling login on it.

Note that internally the server doesn't make any specific distinction between a user account and a role. You can grant a user account to another user account as a role for example.

As far as the SQL standard goes both user accounts and roles are "authentication IDs". They can all be granted privileges and other authentication ids.

Georgi "Joro" Kodinov
MySQL SrvGen team lead
Plovdiv, Bulgaria

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.