具有授权选项的用户不能授予创建用户 [英] User with grant option can't grant create user

查看:46
本文介绍了具有授权选项的用户不能授予创建用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用 root 创建了一个用户 (new_user),如下所示:

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;

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

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?

推荐答案

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

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';

这篇关于具有授权选项的用户不能授予创建用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆