Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2006
    Posts
    63

    Unanswered: How to remove GRANT

    Hi folks,

    OpenBSD 4.0 x86_64
    Mysql
    Postfix_2.4.3


    After running following command;

    mysql> GRANT SELECT, INSERT, UPDATE, DELETE ON test.* TO
    'vmailuser'@'localhost' IDENTIFIED BY 'password123';
    Code:
    Query OK, 0 rows affected (0.00 sec)
    I found I made a mistake to run it. Please advise how to remove GRANT given to vmailuser to test database. TIA


    B.R.
    satimis

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    REVOKE

    it's in the manual under GRANT and REVOKE Syntax

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jun 2006
    Posts
    63
    Hi r937,


    Tks for your advice.

    REVOKE

    it's in the manual under GRANT and REVOKE Syntax
    I found it;

    13.5.1.5. REVOKE Syntax
    http://dev.mysql.com/doc/refman/5.0/en/revoke.html

    Syntax
    Code:
    REVOKE ALL PRIVILEGES, GRANT OPTION FROM user [, user]
    but can't resolve whether retaining the 1st 'user'
    and
    replace [, user] with [, vmailuser]???

    Please shed me some light. TIA


    B.R.
    satimis

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    i've never done this myself, but you could try this --

    REVOKE SELECT, INSERT, UPDATE, DELETE ON test.* FROM 'vmailuser'@'localhost'
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Jun 2006
    Posts
    63
    Quote Originally Posted by r937
    REVOKE

    it's in the manual under GRANT and REVOKE Syntax
    Hi r937,


    Ran;

    mysql> REVOKE SELECT,INSERT,UPDATE,DELETE ON test* FROM 'vmailuser'@'localhost'
    ->

    waiting for input. So I typed

    -> IDENTIFIED BY 'password123';
    Code:
    ERROR 1046 (3D000): No database selected
    mysql>
    Whether I should type \q to exit Mysql ??? Tks


    B.R.
    satimis

  6. #6
    Join Date
    Jun 2006
    Posts
    63
    Hi r937,


    Further to my late posting, your syntax worked with minor adjustment as follow;

    mysql> REVOKE SELECT, INSERT, UPDATE, DELETE ON test.* FROM 'vmailuser'@'localhost';
    Code:
    Query OK, 0 rows affected (0.00 sec)

    mysql> SHOW GRANTS FOR 'vmailuser'@'localhost';
    Code:
    +------------------------------------------------------------------------------------------------------------------+
    | Grants for vmailuser@localhost                                                                                   |
    +------------------------------------------------------------------------------------------------------------------+
    | GRANT USAGE ON *.* TO 'vmailuser'@'localhost' IDENTIFIED BY PASSWORD '*A0F874BC7F54EE086FCE60A37CE7887D8B31086B' | 
    +------------------------------------------------------------------------------------------------------------------+
    1 row in set (0.00 sec)
    Tks


    B.R.
    satimis

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •