MySQL 8.0 Database Administrator — Question 77
User account baduser@hostname on your MySQL instance has been compromised.
Which two commands stop any new connections using the compromised account? (Choose two.)
Answer options
- A. ALTER USER baduser@hostname PASSWORD DISABLED;
- B. ALTER USER baduser@hostname MAX_USER_CONNECTIONS 0;
- C. ALTER USER baduser@hostname ACCOUNT LOCK;
- D. ALTER USER baduser@hostname IDENTIFIED WITH mysql_no_login;
- E. ALTER USER baduser@hostname DEFAULT ROLE NONE;
Correct answer: C, D
Explanation
The correct commands are C and D because 'ACCOUNT LOCK' prevents any further logins for the specified user, effectively stopping new connections. The command 'IDENTIFIED WITH mysql_no_login' also prevents the user from logging in, but the other options either do not block connections or do not directly address account access.