撤消MySQL数据库上所有用户的所有特权 [英] Revoke all privileges for all users on a MySQL DB

查看:102
本文介绍了撤消MySQL数据库上所有用户的所有特权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

来自: http://dev.mysql.com/doc/refman/5.0/zh-CN/drop-database.html

...当删除数据库时,不会自动删除该数据库的用户特权.

...when a database is dropped, user privileges on the database are not automatically dropped.

问题就变成了,如何撤销MySQL数据库上所有用户的所有特权?我以为它很简单,但是令我惊讶的是我没能在任何地方找到它.

So the question becomes, how do you revoke all privileges for all users on a MySQL DB? I imagine it's simple, but I'm surprised I haven't been able to find this anywhere.

推荐答案

您可以使用

这将删除一个或多个指定用户的所有全局,数据库,表,列和例程特权

which drops all global, database, table, column, and routine privileges for the named user or users

不过,不确定是否有办法一次为所有用户执行此操作.

Not sure if there's a way to do this for all users at once, though.

这篇关于撤消MySQL数据库上所有用户的所有特权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆