简体   繁体   English

Mysql撤销特权不影响现有的连接

[英]Mysql Revoke Privileges Not Affecting For Existed Connections

I have permission for creation and drop database option for a user and one of user connected with mysql and creating/droping db's and still connection exist with db through workbench. 我拥有一个用户的创建和删除数据库选项的权限,并且其中一个用户与mysql连接并创建/删除数据库,并且仍然通过工作台与数据库存在连接。 Now i am revoking drop option from user but its not working with already connected user. 现在,我正在撤消用户的drop选项,但它不适用于已连接的用户。 I want to revoke immediately from all user even if they are connected or not. 我想立即撤销所有用户的权限,即使他们没有连接也是如此。

If you revoked the privileges via update statements on the privilege tables, make sure you execute this thereafter: 如果通过特权表上的更新语句撤消了特权,请确保在此之后执行此操作:

FLUSH PRIVILEGES;

Then you can force a disconnect by killing the user's threads. 然后,您可以通过杀死用户的线程来强制断开连接。 Do

SHOW PROCESSLIST;

and look for every Id where User column is the user you want to revoke the privileges from. 并在“ User列中查找您要从中撤消特权的用户,查找每个Id Then kill the threads. 然后杀死线程。

KILL <whatever Id you noticed from show processlist>;

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

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