2
votes

I have a user, and I'm logged in as that user. That user does:

create database bugs;

Works OK.

grant all on bugs.* to 'bugs@localost';

And I get that I do not have Grant Access (current logged in user).

I show privs for the logged in user (verified by select user(); )
+---------------------------------------------------------------------------------------------------------------+
| Grants for user1@% |
+---------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'user1'@'%' IDENTIFIED BY PASSWORD '*' |
| GRANT ALL PRIVILEGES ON aDatabase.* TO 'user1'@'%' |
+---------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

(I changed the user I was logged in as to user1, and the 2nd all privs to aDatabase
I can login as root and grant the privileges just fine...

So what privs do I need beyond 'ALL PRIVILEGES'??!?? And what command grants them to me.

1
I just ran 'grant grant option on . to 'user1'; - maybe the grant option isn't considered a privilege in terms of 'grant all'... Best guess...Traderhut Games

1 Answers

2
votes

The problem is that executing the problematic statement

grant all on bugs.* to 'bugs@localost';

requires a privilege called GRANT OPTION which, contrary to what you may think is not included in ALL PRIVILEGES. Even then, the user will only be able to grant privileges to other users that he has in the first place. See the online documentation.

To include the GRANT OPTION with your first grant command, use this:

GRANT ALL PRIVILEGES ON *.* TO 'user1'@'%' WITH GRANT OPTION;

I have removed the IDENTIFIED BY PASSWORD clause from your grant statement.