QuestionQ103

Database Security

Examine Joe's account:

CREATE USER 'joe'@'%' IDENTIFIED BY '*secret*'  
GRANT ALL PRIVILEGES ON *.* TO 'joe'@'%'  

All existing connections for joe are terminated.

Which two commands will prevent joe from establishing access to the MySQL instance?

Choose two
  • 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'@'%'
Explanation

ALTER USER ... ACCOUNT LOCK prevents the account from authenticating. ALTER USER ... IDENTIFIED BY '*invalid*' PASSWORD EXPIRE replaces the password and immediately expires it; connections using an expired password are either rejected or restricted solely to password-reset activity. Privilege revocation does not remove the account or prevent successful authentication.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!