Skip to content

REVOKE

CREATE USER 'new_user'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'new_user'@'localhost';
REVOKE INSERT ON *.* FROM 'new_user'@'localhost';
Query OK, 0 rows affected (0.01 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)

In this example, the REVOKE statement is used to remove the INSERT privilege from the new_user. The user was initially granted ALL PRIVILEGES. After the REVOKE statement, ‘new_user’ no longer has the right to perform INSERT operations on any database on the MySQL server.