SQL GRANT and REVOKE Command:
GRANT statement:
GRANT statement is used to give
permission or grant privileges to a user account on the table and database.
REVOKE statement:
REVOKE statement is used to remove
permission or remove privileges from a user account on the table and database.
Syntax:
GRANT privileges_names ON object
TO user;
Syntax:
REVOKE
privileges ON object FROM user;
Parameters Used:
·
Privileges_name:
These are the access rights or privileges granted to the user.
·
Object: It is the name of the database object or
table to which permissions are being granted. In the case of granting
privileges on a table, this would be the table name.
·
User: It is the name of the user to whom the privileges
would be granted.
Example:
GRANT SELECT, INSERT, DELETE,
UPDATE ON Customer TO 'Amit'@'localhost;
REVOKE SELECT, INSERT, DELETE,
UPDATE ON Customer TO 'Amit'@'localhost;
0 Comments