If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > How to remove GRANT

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-12-07, 11:03
satimis satimis is offline
Registered User
 
Join Date: Jun 2006
Posts: 56
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
Reply With Quote
  #2 (permalink)  
Old 06-12-07, 11:16
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
REVOKE

it's in the manual under GRANT and REVOKE Syntax

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 06-12-07, 11:47
satimis satimis is offline
Registered User
 
Join Date: Jun 2006
Posts: 56
Hi r937,


Tks for your advice.

Quote:
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
Reply With Quote
  #4 (permalink)  
Old 06-12-07, 11:53
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
i've never done this myself, but you could try this --

REVOKE SELECT, INSERT, UPDATE, DELETE ON test.* FROM 'vmailuser'@'localhost'
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #5 (permalink)  
Old 06-12-07, 12:04
satimis satimis is offline
Registered User
 
Join Date: Jun 2006
Posts: 56
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
Reply With Quote
  #6 (permalink)  
Old 06-12-07, 13:18
satimis satimis is offline
Registered User
 
Join Date: Jun 2006
Posts: 56
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On