After command

GRANT ALL PRIVILEGES ON `dbname`.* TO 'userA'@'localhost' IDENTIFIED BY 'password';

MySql says ok. Then i log in user A, but when I try to grant some privileges to user B it gives error #1044, saying that user A has no rights to do this. MySql grants all privileges to user A, and at the same time it doesn't allow him to do anything. I have no idea how to solve this.


1 Answer 1


all does not include the grant privilege.

Quote from the documentation:

The optional WITH clause is used to enable a user to grant privileges to other users. The WITH GRANT OPTION clause gives the user the ability to give to other users any privileges the user has at the specified privilege level.

To grant the GRANT OPTION privilege to an account without otherwise changing its privileges, do this:

GRANT USAGE ON *.* TO 'someuser'@'somehost' WITH GRANT OPTION;

So, in your case:

GRANT ALL PRIVILEGES ON `dbname`.* TO 'userA'@'localhost'

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .