In MySQL, you can use the REVOKE statement to remove certain permissions of a user (the user will not be deleted), which can ensure the security of the system to a certain extent. For example, if the database administrator feels that a user should not have DELETE permission, then the DELETE permission can be removed. There are two forms of syntax for removing permissions using the REVOKE statement, as follows: 1) The first type Delete certain specific permissions of the user. The syntax format is as follows: REVOKE priv_type [(column_list)]... ON database.table FROM user [, user]... The parameters in the REVOKE statement have the same meaning as the parameters in the GRANT statement. in:
2) The second type Delete all permissions for a specific user. The syntax is as follows: REVOKE ALL PRIVILEGES, GRANT OPTION FROM user [, user] ... When deleting user permissions, please note the following points:
Example 1 Use the REVOKE statement to revoke the insert permission of user testUser. The SQL statement and execution process are as follows. mysql> REVOKE INSERT ON *.* -> FROM 'testUser'@'localhost'; Query OK, 0 rows affected (0.01 sec) mysql> SHOW GRANTS FOR 'testUser'@'localhost'; +-----------------------------------------------------------------+ | Grants for testUser@localhost | +-----------------------------------------------------------------+ | GRANT SELECT ON *.* TO 'testUser'@'localhost' WITH GRANT OPTION | +-----------------------------------------------------------------+ 1 row in set (0.00 sec) The result shows that the INSERT permission of the testUser user is deleted successfully. This is the end of this article about MySQL REVOKE to delete user permissions. For more information about MySQL REVOKE to delete user permissions, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: iframe multi-layer nesting, unlimited nesting, highly adaptive solution
>>: Detailed process of using Vscode combined with docker for development
<br />Web Design and Production Test Part I ...
1. ROW_NUMBER() Definition: The ROW_NUMBER() func...
Installation Script Ubuntu / CentOS There seems t...
Platform deployment 1. Install JDK step1. Downloa...
There are many tags and elements in the HTML head ...
Preface Swap is a special file (or partition) loc...
I think this is a problem that many people have en...
This article shares a sharing sidebar implemented...
Table of contents jQuery's $.ajax The beginni...
Following are the quick commands to clear disk sp...
Table of contents 1. Introduction 2. Environment ...
Some time ago, I needed to use pip downloads freq...
A brief introduction to protobuf Protobuf is Goog...
Table of contents Create a new html file: Create ...
Table of contents Preparation Install VMware Work...