【发布时间】:2019-05-10 14:56:23
【问题描述】:
我已经在 PhpMyAdmin 和 DataGrip 中尝试过这个查询:
drop user god_user, god;
create user god_user identified by 'god', god identified by 'god';
grant all on *.* to god with grant option ;
grant god to god_user;
show grants for god_user
似乎一切正常,show grants for god_user 显示如下:
GRANT USAGE ON *.* TO `god_user`@`%`
GRANT `god`@`%` TO `god_user`@`%`
使用 PhpMyAdmin,我可以以 god 登录,然后看到 ALL PRIVILEGES 的标志 GRANT 设置为 YES。但是god_user 呢,它表明god_user 没有权限。为什么?如果我以god_user 身份登录PhpMyAdmin,我什至看不到我的数据库列表!
这是一个错误吗?我grant all on *.* to god_user with grant option就可以了。
flush privileges 没有给我任何新东西。另外,如果god 是role,而不是user(我认为没有太大区别)。我是root。
【问题讨论】:
-
将一个用户的权限授予另一个用户时,不需要使用Proxy关键字吗?
-
@HoneyboyWilson,我只需要激活我的角色)