Revoke Privileges

Posted by alex almazan Mon, 17 Dec 2007 23:18:00 GMT

SQL grants can certainly leave a host vulnerable, especially if the door is left open for a remote ‘consultant’. Here is a quick example of a revocation of grants:

mysql> show grants for root@ip.address;
+-------------------------------------------------------------------------------------------------------------------+
| Grants for root@ip.address                                                                                     |
+-------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'ip.address' IDENTIFIED BY PASSWORD '2ac2db3645cd1434' WITH GRANT OPTION |
+-------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> REVOKE  ALL ON *.* FROM 'root'@'ip.address' IDENTIFIED BY PASSWORD '2ac2db3645cd1434';
Query OK, 0 rows affected (0.02 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)