|
¡¡
|
Chapter 6 - Data Control of HYSQL
|
To grant permission to access database objects.
1. GRANT statement:
Syntax: GRANT permission ON
object TO username[,username]...
[ WITH GRANT OPTION]
Here:
permission can be one of the
following items:
SELECT,INSERT,UPDATE,DELETE,CREATE,INDEX,ALTER,DROP,GRANT,REVOKE,ALL,RUN.
object can be tablename or virwname or
Java class name.
(a) When permission also is GRANT,the
grantor grant the GRANT permission to the grantee,the grantee can grant the
specified permission to other grantee;WITH
GRANT OPTION clause isn't recommended to use.
(b) The grantor must have the GRANT permission on
the object;
(c) The grantor must have the permission that
will be granted on the object;
(d) The object of CREATE permission
is only CREATE.GRANT;therefore,you must have the GREATE and INDEX permission to
create the index database;
(e) to use the ALL permission,the grantor grants
all permissions that the grantor haved on the object to the grantee;
2. REVOKE statement:
Syntax: REVOKE permission
ON
object FROM username
(a) The revoker must have the REVOKE permission
on the object;
(b) The revoker must have the permission that
will be revoked on the object.
Return
|
¡¡ |