MySQL REVOKE GRANT usage is a helpful tool when it comes to managing the MySQL database. Read on to learn more.
At Bobcares, we offer solutions for every query, big and small, as a part of our MySQL Support Services.
Let’s take a look at how our MySQL Support Team is ready to help customers understand more about MySQL REVOKE GRANT usage.
How to REVOKE GRANT usage in MySQL
Did you know that privilege management plays a critical role in system and database administration? Hence, commands to grant and revoke privileges are important. MySQL offers us a dependable privilege assignment system that helps us implement access policies easily.
In fact, each time a user tries to perform an action, MySQL verifies if the user has the proper privilege to go ahead with the action. If yes, MySQL executes the statements else as an error occurs.
MySQL stores the user privilege information in several tables in the mysql system database.
If you are looking for a way to revoke privileges after granting them, you have come to the right place. We can do this, via the revoke command. Furthermore, we can revoke a combination of INSERT, SELECT, DELETE, UPDATE, REFERENCES, ALL, or ALTER.
Here is the basic syntax of the statement:
REVOKE <privileges> ON <database>.<object> FROM '<user>'@'<host>';
For instance:
REVOKE INSERT ON *.* FROM 'joe'@'localhost'; REVOKE 'role1', 'role2' FROM 'newuser'@'localhost', 'olduser'@'localhost'; REVOKE SELECT ON world.* FROM 'role';
In order to use the MySQL REVOKE GRANT usage statement, we have to specify the scope from which we want to remove the privilege. Moreover, we can remove a privilege from the global level with *.& wildcard.
For instance:
REVOKE SELECT ON *.* FROM 'bob'@'localhost';
Furthermore, we can use the REVOKE command to remove a privilege from a particular database as seen below:
REVOKE SELECT ON suppliers.* FROM 'john'@'localhost';
Moreover, we can use the REVOKE command to remove a privilege from a particular database object as seen below:
REVOKE UPDATE ON suppliers.revenue FROM 'derek'@'localhost';
Additional, we can check the user’s available privileges with the following command:
SHOW GRANTS FOR 'bob'@'localhost';
At the end of the day, the MySQL REVOKE GRANT usage comes in handy while revoking privileges from users.
[Need assistance with another query? We are available 24/7.]
Conclusion
In a nutshell, our skilled MySQL Support Engineers at Bobcares helped us understand more about MySQL REVOKE GRANT usage.
PREVENT YOUR SERVER FROM CRASHING!
Never again lose customers to poor server speed! Let us help you.
Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.
0 Comments