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
As shown below: update table1 as z left join tabl...
This article shares the specific code of using ca...
Replace it with the optimal database connection p...
Table of contents Preface 1. Configure intranet D...
There are three types of attribute value regular ...
Preface HTTP is a stateless communication protoco...
Use CSS to modify the browser scroll bar style ::...
Table of contents v-model .sync The difference in...
1. Naming conventions 1. Database names, table na...
1. Check Linux disk status df -lh The lsblk comma...
Table of contents Preface analyze Data Total Repe...
The most common mistake made by many website desi...
1. Add in package.json "main": "el...
This article shares the specific code of JavaScri...
1. Virtual Machine Preparation 1. Create a new vi...