简体   繁体   English

我想使用“授予选项”命令将确切的特权分配给一个用户,以便在MYSQL中将另一个用户分配给另一个用户

[英]using the “grant options” command i want to assign the exact privileges as one user to another in MYSQL

Not sure if this can be done but from everything I read it seems possible, just not sure how to code it. 不知道是否可以做到这一点,但是从我阅读的所有内容来看,似乎都是可能的,只是不确定如何编写代码。 at best I would imagine it would look something like 充其量我想我会看起来像

CREATE USER user1@localhost IDENTIFIED BY 'passwd';
GRANT OPTIONS userA
ON test
TO user1

and that is where I get lost, how do I tell my schema I want to grant 'user1' the exact privileges as 'userA'. 这就是我迷路的地方,如何告诉我的模式我想授予'user1'确切的特权为'userA'。 thanks in advance, and I think that I am close or on the right track. 在此先感谢您,我认为我已经接近或步入正轨。
MYSQL workbench 5.2.38 CE MYSQL工作台5.2.38 CE

I FOUND THIS 我找到了这个

**GRANT PROXY ON 'localuser'@'localhost' TO 'externaluser'@'somehost'; ** GRANT PROXY ON'localuser'@'localhost'到'externaluser'@'somehost';

When PROXY is granted, it must be the only privilege named in the GRANT statement, the REQUIRE clause cannot be given, and the only permitted WITH option is WITH GRANT OPTION. 授予PROXY时,它必须是GRANT语句中命名的唯一特权,不能给出REQUIRE子句,并且唯一允许的WITH选项是WITH GRANT OPTION。

Proxying requires that the proxy user authenticate through a plugin that returns the name of the proxied user to the server when the proxy user connects, and that the proxy user have the PROXY privilege for the proxied user. 代理要求代理用户通过插件进行身份验证,该插件在代理用户连接时将代理用户的名称返回到服务器,并且代理用户具有代理用户的代理权限。 For details and examples, see Section 6.3.7, “Proxy Users”. 有关详细信息和示例,请参见第6.3.7节“代理用户”。

so it can be done, and I have not referred to section 6.3.7 just yet. 因此可以做到,而我还没有提到6.3.7节。 Once I know more I will post more ** 了解更多信息后,我会发布更多**

Ok. 好。 If you want, you can just copy the record of user from mysql table and esit the user name. 如果需要,您可以仅从mysql表中复制用户记录并输入用户名。 Then execute flush privileges. 然后执行刷新特权。

This works before for me. 这对我来说很有效。

Hope it helps. 希望能帮助到你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM