MySQL Forums
Forum List  »  Security

Re: restricting privileges on tables
Posted by: Georgi Kodinov
Date: May 25, 2016 08:43AM

Privileges can be manipulated individually, no matter that they're granted as a group. E.g. I have:
mysql> create database db1;
--------------
create database db1
--------------

Query OK, 1 row affected (0.00 sec)
mysql> GRANT USAGE ON *.* TO 'user'@'%' IDENTIFIED BY 'XXX';
--------------
GRANT USAGE ON *.* TO 'user'@'%' IDENTIFIED BY 'XXX'
--------------

Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> GRANT SELECT, INSERT, UPDATE, DELETE, EXECUTE ON db1.* to 'user'@'%';
--------------
GRANT SELECT, INSERT, UPDATE, DELETE, EXECUTE ON db1.* to 'user'@'%'
--------------

Query OK, 0 rows affected (0.00 sec)

mysql> revoke INSERT,UPDATE,DELETE ON db1.* FROM 'user'@'%';
--------------
revoke INSERT,UPDATE,DELETE ON db1.* FROM 'user'@'%'
--------------

Query OK, 0 rows affected (0.00 sec)

mysql> show grants for 'user'@'%';
--------------
show grants for 'user'@'%'
--------------

+------------------------------------------------+
| Grants for user@% |
+------------------------------------------------+
| GRANT USAGE ON *.* TO 'user'@'%' |
| GRANT SELECT, EXECUTE ON `db1`.* TO 'user'@'%' |
+------------------------------------------------+
2 rows in set (0.00 sec)

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: restricting privileges on tables
1005
May 25, 2016 08:43AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.