简体   繁体   English

使用MySQL Workbench向用户添加表特权

[英]Add table privileges to user using mySQL Workbench

I've created a user using the server administration tools in mySQL workbench and can assign global and database permissions to those users from the administration tool. 我已经使用mySQL工作台中的服务器管理工​​具创建了一个用户,并且可以从管理工具向这些用户分配全局和数据库权限。

Is there a way to assign those users (stored in mysql.users) table level privileges in mySQL Workbench? 有没有办法在mySQL Workbench中分配这些用户(存储在mysql.users中)表级特权?

Thanks 谢谢

I did find a workaround. 我确实找到了解决方法。 Not elegant, but it works. 不优雅,但是可以。

  1. Open your database as an EER Model. 作为EER模型打开数据库。
  2. 2 tabs will open, go to the one that is not selected by default (MySQL Model). 将打开2个选项卡,转到默认未选择的选项卡(MySQL模型)。
  3. Follow the directions here to add roles/users. 请按照此处的说明添加角色/用户。
  4. Forward Engineer the model back to the database. 将模型向前工程回数据库。 You can deselect all objects except the users. 您可以取消选择除用户之外的所有对象。
  5. You can either have Workbench create the users, or, if you already have the users, just set the grant statements 您可以让Workbench创建用户,或者如果已经有用户,则只需设置Grant语句

Not pretty, but it works 不漂亮,但是可以用

Unfortunatly there's no way you can do that in Workbench Administrator module, as of WB 5.2.37. 不幸的是,从WB 5.2.37开始,您无法在Workbench Administrator模块中执行此操作。

You can always grant the access using SQL commands (see previous comments) in Workbench's SQL Query Editor. 您始终可以在Workbench的SQL查询编辑器中使用SQL命令(请参见前面的注释)授予访问权限。 Just don't forget to FLUSH PRIVILEGES after that. 只是不要忘了在那之后FLUSH PRIVILEGES一下FLUSH PRIVILEGES

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

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