can't copy user or role privileges in MySql 8.0

Victor Gorban

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.

Victor Gorban

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.

edited at
0

Comments

0 comments
Login to comment

Related

Mysql user can't update temp table (has all privileges)

MySQL 8.0.18 all privileges on a database for role doesn't allow user to create the database

How can I change mysql user privileges?

MySQL User with select privileges can still update

Can't add user to a role

AWS MySQL RDS can't create new DB user while having ALL PRIVILEGES

Mysql grant privileges get error ERROR 1133 (42000): Can't find any matching row in the user table

Mysql.User doesn't show all of the privileges

Can't add a role to a user. JDA

can't grant user privileges to postgresql database (for a rails app)

Can't assign Default User role to a new user

MYSQL v8 Privileges

No user in mongodb with admin privileges - how can create an user with admin privileges?

Can't assign a default user_role="ROLE_USER" with Hibernate

Retrieve privileges using security role rather than using system user

i can't assign a role to an user, via my code

can't use assign role to User where i give factory

Can't give service account permissions to apply an existing role "Error from server (Forbidden) ... attempt to grant extra privileges"

Multi user role in laravel 8

GCP SQL Postgres problem with privileges : can't run a query with postgres user with generated symfony db

Can't find matching rows in table error when trying to grant privileges to mariadb user

How to revoke MySQL user privileges for one table?

Cannot grant privileges to a user using root on mysql

Creating a user and granting all privileges on mySQL

Difference between Create User and Grant Privileges in MySQL

MySQL user privileges not working when using IP

User with no privileges can alter table in oracle

How can I check user privileges in Memgraph?

Why can't make dumps of MySQL DB even though I have ALL privileges?