I've tried this queries in PhpMyAdmin and DataGrip:
drop user god_user, god;
create user god_user identified by 'god', god identified by 'god';
grant all on *.* to god with grant option ;
grant god to god_user;
show grants for god_user
It seems like all is OK, show grants for god_user
shows this:
GRANT USAGE ON *.* TO `god_user`@`%`
GRANT `god`@`%` TO `god_user`@`%`
And with PhpMyAdmin, I could login as god
and see that I have ALL PRIVILEGES
with flag GRANT
set to YES
. But what about god_user
, it shows that there's NO privileges for god_user
. Why? And if I login into PhpMyAdmin as god_user
, I can't even see my DBs list!
Is that a bug? It is OK if I grant all on *.* to god_user with grant option
.
flush privileges
gives me nothing new. Also if god
is a role
, not user
(I think there's no big difference). I am root.
The problem was ultra-dumb: I forgot to activate my roles. The following code fixed my issue. (It activates all granted roles to specified users.)
set default role all to god_user, admin;
And that's it)
The paragraph about 'activating roles' WAS in documentation, but I skipped it...
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments