In mysql, you can use the REVOKE statement to delete the permissions of a specified user (specified permissions or all permissions). The syntax to cancel all permissions is "REVOKE ALL PRIVILEGES, GRANT OPTION FROM user;". For the REVOKE statement to take effect, you must have the global CREATE USER permission or UPDATE permission of the MySQL database.
The operating environment of this tutorial: windows7 system, mysql8 version, Dell G3 computer.
In MySQL, you can use the REVOKE
statement to delete some or all permissions of a user.
Delete all permissions of a specific user, the syntax format is as follows:
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 用户;
You need to pay attention to the following points when deleting user permissions:
Example: Assume that the rfc user has SELECT, UPDATE, and DELETE permissions on the sample database.
To revoke all permissions from the rfc user, execute the following command:REVOKE ALL PRIVILEGES, GRANT OPTION FROM rfc;
SHOW GRANTS FOR rfc; GRANT USAGE ON *.* TO 'rfc'@'%';
When the MySQL REVOKE command takes effect
The effect of the MySQL REVOKE statement depends on the permission level, as follows:mysql video tutorial]
The above is the detailed content of How to cancel all permissions in mysql. For more information, please follow other related articles on the PHP Chinese website!