简体   繁体   English

MySQL 角色在 Delphi 应用程序中不起作用

[英]MySQL roles don't work in a Delphi application

I am using MariaDB10 with DBForge and creating a Delphi Project, I created a role to manage the permissions but it's not working good.我将 MariaDB10 与 DBForge 一起使用并创建了一个 Delphi 项目,我创建了一个角色来管理权限,但效果不佳。

1 - Create a role on DbForge panel with a permission for a procedure myprocedure 1 - 在 DbForge 面板上创建一个具有过程myprocedure权限的myprocedure

2 - Add a Tmyquery in my Delphi project with the code set default role myrole 2 - 使用代码set default role myrole在我的 Delphi 项目中添加一个set default role myrole

3 - Add a procedure on afterConnect calling the query created 3 - 在afterConnect上添加一个过程,调用创建的查询

4 - Set disconnectedMode = true on MyConnection options 4 - 在 MyConnection 选项上设置disconnectedMode = true

Sometimes this process works, but most times I receive an Error: Acess denied to user XX for routine myprocedure有时此过程有效,但大多数情况下我会收到错误: Acess denied to user XX for routine myprocedure

This happens with routines, functions and tables that I try to control the permissions这发生在我试图控制权限的例程、函数和表中

Besides that every time that I give a permission on a role and after edit the procedure the role loses the permission that I gave before除此之外,每次我授予角色权限时,在编辑程序后,角色都会失去我之前授予的权限

Obs: The roles work okey on DbForge panel is just when I tried to put this on Delphi Obs:DbForge 面板上的角色工作正常是我尝试将其放在 Delphi 上的时候

If the user doesn't already have access to that role then them running set default role myrole doesn't give it to them.如果用户还没有该角色的访问权限,则他们运行set default role myrole不会将其授予他们。

SET DEFAULT ROLE requires these privileges: SET DEFAULT ROLE 需要以下权限:

Setting the default roles for another user requires the global CREATE USER privilege, or the UPDATE privilege for the mysql.default_roles system table.为另一个用户设置默认角色需要全局 CREATE USER 权限,或 mysql.default_roles 系统表的 UPDATE 权限。

Setting the default roles for yourself requires no special privileges, as long as the roles you want as the default have been granted to you.为自己设置默认角色不需要特殊权限,只要您希望作为默认角色的角色已经授予您即可。

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

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