1Z0-908 practice question 25 of 25

Which two methods allow a DBA to reset a user's password? (Choose two.)

Full set: 140 questions
Answer options
A: ALTER USER statement Correct answer
B: mysql_secure_installation utility
C: SET PASSWORD statement Correct answer
D: mysqladmin client program
E: GRANT statement
Correct Answer:
A. ALTER USER statement; C. SET PASSWORD statement
Explanation

In MySQL 8.0, a Database Administrator (DBA) can reset a user's password using specific SQL statements. The ALTER USER statement is the recommended and most comprehensive method for modifying user account attributes, including the password. The SET PASSWORD statement is also a valid and direct method specifically designed for assigning a new password to a user account. Both statements can be executed by a user with the appropriate privileges (such as a DBA) to change the password for any other user account without needing to know the old password.

Why Incorrect

B. mysqlsecureinstallation is an interactive script used for initial security hardening of a MySQL instance, not for routine password management of individual users.
D. The mysqladmin password command requires the user's current password to set a new one, making it unsuitable for a DBA to reset a password for another user.
E. Using the GRANT statement with an IDENTIFIED BY clause for password management is deprecated in MySQL 8.0 and is not the correct or recommended method.

References

1. MySQL 8.0 Reference Manual, Section 13.7.1.1, "ALTER USER Statement": "The ALTER USER statement modifies existing MySQL accounts. It enables DBAs to change account authentication, SSL/TLS, and resource-limit characteristics, and to assign and alter passwords." This source confirms ALTER USER is a primary tool for DBAs to manage passwords.

2. MySQL 8.0 Reference Manual, Section 13.7.1.9, "SET PASSWORD Statement": "A user who has the UPDATE privilege for the mysql system schema can set the password for any account. For other users, they can set the password only for their own account." This confirms a DBA can use this statement to reset any user's password.

3. MySQL 8.0 Reference Manual, Section 4.5.2, "mysqladmin — A MySQL Server Administration Program": The description for the password command states: "The server prompts for the old password, then for the new password twice." This confirms it cannot be used by a DBA to reset a password without knowing the original.

4. MySQL 8.0 Reference Manual, Section 13.7.1.6, "GRANT Statement": "The IDENTIFIED BY clause is deprecated for GRANT and subject to removal in a future MySQL release." This confirms GRANT is not the proper method for password management.

Scroll to Top