Home >Database >SQL >The command to reclaim user operation permissions in sql is

The command to reclaim user operation permissions in sql is

下次还敢
下次还敢Original
2024-05-02 01:09:17622browse

In SQL, the command to revoke user operation permissions is REVOKE, and its syntax is as follows: REVOKE [GRANT OPTION FOR] <Permissions> ON FROM . Permissions can be SELECT, INSERT, UPDATE, DELETE, CREATE, or DROP. The object can be a table, view, or procedure. Only users with administrator rights can reclaim the rights of other users.

The command to reclaim user operation permissions in sql is

The command to revoke user operation permissions in SQL

In SQL, the command to revoke user operation permissions isREVOKE.

Use REVOKE command

REVOKE The syntax of the command is as follows:

<code>REVOKE [GRANT OPTION FOR] <权限> ON <对象> FROM <用户></code>

Among them:

  • [GRANT OPTION FOR]: Optional parameter, specifying whether to also recycle options for granting permissions.
  • <Permissions>: The permission to be reclaimed can be one of the following:

    • SELECT
    • INSERT
    • UPDATE
    • DELETE
    • CREATE
    • DROP
  • ##: The object to be revoked, which can be a table, view or procedure .
  • : The user whose permissions are to be revoked.
  • Example

    The following example recycles user

    user1's SELECT on table table1 Permissions:

    <code class="sql">REVOKE SELECT ON table1 FROM user1;</code>
    The following example revokes all permissions from user

    user2 to view view1, including granting permissions:

    <code class="sql">REVOKE ALL PRIVILEGES ON view1 FROM user2;</code>

    Notes

      Only users with administrator rights can reclaim the rights of other users.
    • If the user has multiple permissions on the object, the
    • REVOKE command will only revoke the specified permissions. To reclaim all privileges, use ALL PRIVILEGES.
    • Options granted permission can only be reclaimed by the user who granted the permission.

    The above is the detailed content of The command to reclaim user operation permissions in sql is. For more information, please follow other related articles on the PHP Chinese website!

    Statement:
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn