PHP - Explain GRANT commands and REVOKE commands with their syntax.

Explain GRANT commands and REVOKE commands with their syntax.

GRANT – is used to assign or grant privileges to users.

Syntax:
GRANT <privilege> <user>

Example:
GRANT CREATE INDEX TO John

REVOKE – is used to revoke or withdraw any privilege.
REVOKE CREATE INDEX FROM John;

Explain GRANT commands and REVOKE commands with their syntax.

GRANT command is used to provide previleges on the data objects such as tables, views, procedures etc, to the users.

Syntax :
GRANT privilege_name ON object_name TO {user_name | PUBLIC | role_name }

[WITH GRANT OPTION]

-privilege_name is the name of the access right that is granted.
-object_name can be a table, view, stored procedure and sequence
-user_name is the user account name , to whom the privilege is granted
-PUBLIC is to grant the privileges to all the users
-role_name is a collective name for a group of privileges
-WITH GRANT OPTION allows the users to grant the privileges to other users.

Example: To grant SELECT privilege on employee table to user Fedrick:
GRANT SELECT ON EMPLOYEE TO FEDRICK.

REVOKE: REVOKE command is used to remove the granted privileges given to the users.

Syntax :
REVOKE privilege_name ON object_name FROM {user_name | PUBLIC | role_name}

Example: To revoke the select privilege on employee table:
REVOKE SELECT ON EMPLOYEE FROM FEDRICK
PHP - Difference between the functions unlink and unset.
Difference between the functions unlink and unset - Unlink is used to delete the file used in the context....
PHP - Explain with an example how to insert javascript in php code.
Explain how to insert javascript in php code - JavaScript can be inserted by specifying the language as...
PHP - Is it possible to send HTML mail with php?
Is it possible to send HTML mail with php? - Yes, using the mail() function of PHP, HTML emails can be sent.....
Post your comment