mysql> revoke all privileges,grant option from 'testuser';
ERROR 1269 (HY000): Can't revoke all privileges for one or more of the requested users
mysql> REVOKE GRANT OPTION ON *.* FROM 'testuser'@'localhost';
Query OK, 0 rows affected (0.02 sec)
ERROR 1269 (HY000): Can't revoke all privileges for one or more of the requested users
出错原因:
Before MySQL 4.1.2, all privileges cannot be dropped at once. Two statements are necessary:
REVOKE
ALL PRIVILEGES ON *.* FROM user [, user] ...
REVOKE GRANT OPTION ON *.* FROM user [, user] ...
mysql> REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'testuser';
ERROR 1269 (HY000): Can't revoke all privileges for one or more of the requested users
mysql> REVOKE ALL PRIVILEGES ON *.* FROM 'testuser'@'localhost';
Query OK, 0 rows affected (0.02 sec)mysql> REVOKE GRANT OPTION ON *.* FROM 'testuser'@'localhost';
Query OK, 0 rows affected (0.02 sec)
本文介绍了在MySQL中如何正确地撤销用户的全部权限。由于历史原因,在MySQL 4.1.2之前,不能一次性撤销所有权限,需要分两步操作:首先撤销所有特权,然后撤销授予选项。文中提供了具体的SQL命令示例。
3181

被折叠的 条评论
为什么被折叠?



