netdjw
netdjw

Reputation: 6007

MySQL Access denied on grant all privileges with an admin user

When I try to grant privileges to a user with an admin user I get this error message:

GRANT ALL PRIVILEGES ON `awesomeproject`.* TO 'awesomeproject'@'localhost';

Result:

ERROR 1044 (42000): Access denied for user 'mygoodadmin'@'localhost' to database 'awesomeproject'

If I check the current user's privileges with this command:

SHOW GRANTS FOR 'mygoodadmin'@'localhost';

I get this result:

+------------------------------------------------------------+
| Grants for mygoodadmin@localhost                           |
+------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'mygoodadmin'@'localhost'            |
| GRANT ALL PRIVILEGES ON `%`.* TO 'mygoodadmin'@'localhost' |
+------------------------------------------------------------+

What I missed?

Upvotes: 1

Views: 1877

Answers (1)

netdjw
netdjw

Reputation: 6007

The solution is based on Akina's comment:

GRANT ALL PRIVILEGES ON *.* TO 'dcms_central'@'localhost' WITH GRANT OPTION;

The additional information:

*.* is the good way, not this one:

`%`.*

Upvotes: 2

Related Questions