mmaport.blogg.se

Mysql create user query ok 0 rows affected
Mysql create user query ok 0 rows affected












mysql create user query ok 0 rows affected

This doesn't happen with global grants on the user or the role, neither with SELECT privileges on database. `joe_role` with the **very same** grants as the user, when assigned to the user, prevents them from creating database. | GRANT ALL PRIVILEGES ON `joe_db`.* TO | Just to be clear, I let me give you a brief example on what am I complaining about and what doesn't make sense to me: It sounds like a bug to me but if that's by design, my personal opinion is that the refman should have an enumeration of privileges which are assigned to a role on granting ALL privileges. It would be great if the documentation mentioned that granting ALL privileges for a role doesn't actually grant ALL privileges, but just some. Michael Bausano Thank you for your quick response. Since I couldn't find it in the manref, I suspect it's a bug.ĮRROR 1044 (42000): Access denied for user to database 'joe_db'įor the sake of eliminating other issues, let's see what happens when we set joe privileges to global. Doing this will prevent us from creating a database. Let's login as joe again and activate the joe_role. Mysql> GRANT `joe_role` TO OK, 0 rows affected (0.01 sec) Mysql> GRANT ALL ON `joe_db`.* TO `joe_role`

mysql create user query ok 0 rows affected

We grant the very same privileges to this role as we do on Then we grant joe_role to joe. Now let's login as root again and create a new role joe_role. Now for the sake of eliminating other issues I log in as and assert that my grants indeed work. Mysql> GRANT ALL ON `joe_db`.* TO OK, 0 rows affected, 1 warning (0.02 sec) Mysql> CREATE USER OK, 0 rows affected (0.01 sec) While I omit the second step in my code, I use it here to illustrate how unexpected this behavior is. I use a MySQL 8.0.18 Docker image.įirst we create an actual user and grant it all privileges on joe_db. Revoking the role or granting global privileges make allow the user to be able to create the database again (although neither are viable workarounds). However when that same user is granted a role which has also all privileges upon a database, the user has no longer authority to create the database. When a user is granted all privileges upon a database, they can create the database. Therefore I attribute that behavior to a bug. I noticed a strange behavior which I couldn't find documented anywhere when granting roles to users. You can either allow all three or restrict all three fro this user's access to the kumar database.I use roles to give grants to my MySQL users. | GRANT ALL PRIVILEGES ON `kumar`.* TO |ĮRROR 1044 (42000): Access denied for user to database 'kumar2' I tried to drop kumar2 mysql> show grants for Grants for | I also create a database kumar2 mysql> create database kumar I logged into mysql as kumar and dropped the database kumar mysql> drop database kumar Mysql> grant all on kumar.* to OK, 0 rows affected (0.06 sec) I create a user called kumar and a database called kumar mysql> create database kumar Unfortunately, DROP DATABASE and DROP TABLE fall under the same privilege scope. Something to keep in mind: The DROP privilege encompasses databases, table, and views.

mysql create user query ok 0 rows affected

MYSQL CREATE USER QUERY OK 0 ROWS AFFECTED UPDATE

Perhaps you want to remove the DROP privilege at the global user level UPDATE er SET drop_priv = 'N' WHERE user='.' AND host='.' and db='.'














Mysql create user query ok 0 rows affected