Challenge - 5 Problems
Privilege Revoker
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ query_result
intermediate2:00remaining
What is the effect of this REVOKE command?
Consider the following command executed on a MySQL server:
What is the result of this command?
REVOKE SELECT ON employees FROM 'user1'@'localhost';What is the result of this command?
MySQL
REVOKE SELECT ON employees FROM 'user1'@'localhost';
Attempts:
2 left
💡 Hint
REVOKE removes specific privileges previously granted.
✗ Incorrect
The REVOKE command removes the specified privilege (SELECT) on the specified object (employees table) from the user. It does not affect other privileges or the ability to connect.
📝 Syntax
intermediate2:00remaining
Identify the syntax error in this REVOKE statement
Which option contains a syntax error when trying to revoke privileges in MySQL?
Attempts:
2 left
💡 Hint
Check the keyword used to specify the user in REVOKE.
✗ Incorrect
The REVOKE statement uses FROM to specify the user, not TO. Option C incorrectly uses TO, causing a syntax error.
🧠 Conceptual
advanced2:00remaining
What happens if you revoke a privilege not granted?
If you execute the command:
but 'user1' never had the UPDATE privilege on employees, what will happen?
REVOKE UPDATE ON employees FROM 'user1'@'localhost';but 'user1' never had the UPDATE privilege on employees, what will happen?
Attempts:
2 left
💡 Hint
Think about how MySQL handles revoking privileges that do not exist.
✗ Incorrect
MySQL silently ignores revoking privileges that were never granted. No error is thrown.
❓ query_result
advanced2:00remaining
What privileges remain after this REVOKE?
Given a user 'user1'@'localhost' with privileges: SELECT, INSERT, UPDATE on database 'shop'.
After running:
Which privileges does 'user1' still have on 'shop'?
After running:
REVOKE INSERT ON shop.* FROM 'user1'@'localhost';Which privileges does 'user1' still have on 'shop'?
MySQL
REVOKE INSERT ON shop.* FROM 'user1'@'localhost';
Attempts:
2 left
💡 Hint
REVOKE removes only the specified privilege.
✗ Incorrect
Only the INSERT privilege is revoked. SELECT and UPDATE remain intact.
🔧 Debug
expert3:00remaining
Why does this REVOKE command fail?
A DBA runs this command:
But it returns an error:
What is the reason for this error?
REVOKE ALL PRIVILEGES ON *.* FROM 'user1'@'localhost';But it returns an error:
ERROR 1410 (42000): You are not allowed to revoke all privileges from yourselfWhat is the reason for this error?
MySQL
REVOKE ALL PRIVILEGES ON *.* FROM 'user1'@'localhost';
Attempts:
2 left
💡 Hint
Think about restrictions on revoking privileges from yourself.
✗ Incorrect
MySQL prevents a user from revoking all their own privileges to avoid locking themselves out.