MySQL 8.0 Database Administrator — Question 113
Examine Joe's account:
CREATE USER 'joe'@'%' IDENTIFIED BY '*secret*'
GRANT ALL PRIVILEGES ON *.* TO 'joe'@'%'
All existing connections for joe are killed.
Which two commands will stop joe establishing access to the MySQL instance? (Choose two.)
Answer options
- A. ALTER USER 'joe'@'%' ACCOUNT LOCK
- B. ALTER USER 'joe'@'%' SET password='*invalid*'
- C. REVOKE ALL PRIVILEGES ON *.* FROM 'joe'@'%'
- D. ALTER USER 'joe'@'%' PASSWORD HISTORY 0
- E. ALTER USER 'joe'@'%' IDENTIFIED BY '*invalid*' PASSWORD EXPIRE
- F. REVOKE USAGE ON *.* FROM 'joe'@'%'
Correct answer: C, E
Explanation
The correct answers are C and E. Option C removes all privileges from joe, effectively blocking his access to the MySQL instance. Option E forces joe to change his password to an invalid one and expires it, preventing future logins. The other options either lock the account without terminating existing access or do not effectively stop access.