如果我(或我的 DBA)撤销用户对 MySQL 数据库的访问权限,现有连接会发生什么情况?
特别是,如果应用程序使用持久连接与数据库通信,当访问权限被撤销时,它会立即受到影响吗?
最佳答案
根据手册here :
A revoked role immediately affects any user account from which it was revoked, such that within any current session for the account, its privileges are adjusted for the next statement executed.
Revoking a role revokes the role itself, not the privileges that it represents. If an account is granted a role that includes a given privilege, and is also granted the privilege explicitly or another role that includes the privilege, the account still is granted that privilege after the first role is revoked. For example, if an account is granted two roles that each include SELECT, the account still can select after either role is revoked.
关于mysql - 删除用户的访问权限是否会影响当前连接?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56759993/