Maxim Mironjuk
-
November 18, 2025
Before MySQL 8, a clean privilege model in practice usually meant running the same list of GRANT statements again for every single user, with all the risks of copy work that eventually drifts apart. Since MySQL 8, privileges can be defined once, centrally, as a role and then assigned to any number of users, including the option to make a role automatically mandatory at login or only active on request. This article covers the basic syntax, the difference between mandatory and optionally activated roles, and a practical privilege model for a team with a read only analyst, an app user, and a DBA on a shared Magento database.