MySQL delete user permissions (REVOKE)

MySQL database can use the REVOKE statement to remove a user's permissions, this user will not be deleted.

 

There are two forms of syntax, as follows:

1) The first:

REVOKE <permission type> [(<column name>)] [, <permission type> [(<column name>)]] ...
the ON <object type> <authority name> the FROM <User 1> [, <User 2>] ...

2) The second:

ALL PRIVILEGES REVOKE, the GRANT the OPTION
the FROM User <User 1> [, <User 2>] ...

Syntax is as follows:

  • GRANT and REVOKE syntax statement syntax is similar, but has the opposite effect.
  • The first syntax format for the recovery of certain privileges.
  • The second syntax format for the recovery of all rights of a particular user.
  • To use the REVOKE statement, you must have a MySQL database global CREATE USER privilege or the UPDATE privilege.

[Example] using REVOKE statements to insert permission cancel testUser user, as shown in SQL statements and execution of the following forms.

  mysql> REVOKE INSERT ON *.*      -> FROM 'testUser'@'localhost';  Query OK
Published 44 original articles · won praise 1 · views 10000 +

Guess you like

Origin blog.csdn.net/mysqlsd/article/details/103474703