User with grant option can't grant create user

2019-04-06 15:53发布

I created a user (new_user) with root like this:

GRANT ALL ON labor.* TO 'new_user'@'%' WITH GRANT OPTION;
GRANT ALL ON labor.* TO 'new_user'@'localhost' WITH GRANT OPTION;
GRANT CREATE USER ON *.* TO 'new_user'@'%';
GRANT CREATE USER ON *.* TO 'new_user'@'localhost';
GRANT RELOAD ON *.* TO 'new_user'@'localhost';
GRANT RELOAD ON *.* TO 'new_user'@'%'; 
FLUSH PRIVILEGES;

When I try to create another user the same way but with new_user, I get an access denied error. This error occurs after the GRANT ALL lines.

What else privilege should I add?

1条回答
小情绪 Triste *
2楼-- · 2019-04-06 16:54

The newly create user is missing the grant option on *.* (needed for grant create user on *.* ...)

GRANT GRANT OPTION ON *.* TO 'new_user'@'%';
GRANT GRANT OPTION ON *.* TO 'new_user'@'localhost';
查看更多
登录 后发表回答