7

我用这样的root创建了一个用户(new_user):

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;

当我尝试以相同方式但使用 new_user 创建另一个用户时,我收到拒绝访问错误。此错误发生在 GRANT ALL 行之后。

我还应该添加什么特权?

4

1 回答 1

17

新创建的用户缺少授予选项*.*(需要grant create user on *.* ...

GRANT GRANT OPTION ON *.* TO 'new_user'@'%';
GRANT GRANT OPTION ON *.* TO 'new_user'@'localhost';
于 2013-09-03T13:03:08.007 回答