1Z0-888 · Question #17
You have the following in my.cnf configuration file: [mysqld] default_authentication_plugin=sha256_password You want to create a new user who will be connecting from the IP address 192.0.2.10, and…
The correct answer is B. CREATE USER 'webdesign'@'192.0.2.10' IDENTIFIED BY 'imbatman'; F. CREATE USER 'webdesign'@'192.0.2.10' IDENTIFIED BY SHA256 AS 'imbatman'. Options B and C are the syntactically correct answers - the stated answer of "F" appears to be an error in this exam question, as IDENTIFIED BY SHA256 AS 'imbatman' is not valid MySQL syntax. Why B works: Since my.cnf sets default_authentication_plugin=sha256_password, omitting…
Question
Options
- ACREATE USER 'webdesign'@'192.0.2.10' IDENTIFIED AS sha256_user WITH SHA256_PASSWORD 'imbatman';
- BCREATE USER 'webdesign'@'192.0.2.10' IDENTIFIED BY 'imbatman';
- CCREATE USER 'webdesign'@'192.0.2.10' IDENTIFIED WITH sha256_password BY 'imbatman';
- DCREATE USER WITH SHA256_password 'sha256_user'@'192.0.2.10' IDENTIFIED AS 'webdesign' USING 'imbatman';
- ECREATE USER 'webdesign'@'192.0.2.10' WITH mysql_native_password USING SHA256 BY 'imbatman';
- FCREATE USER 'webdesign'@'192.0.2.10' IDENTIFIED BY SHA256 AS 'imbatman';
How the community answered
(26 responses)- A4% (1)
- B73% (19)
- D8% (2)
- E15% (4)
Explanation
Options B and C are the syntactically correct answers - the stated answer of "F" appears to be an error in this exam question, as IDENTIFIED BY SHA256 AS 'imbatman' is not valid MySQL syntax.
Why B works: Since my.cnf sets default_authentication_plugin=sha256_password, omitting a plugin in IDENTIFIED BY 'imbatman' causes MySQL to automatically apply SHA-256 hashing - no explicit plugin declaration needed.
Why C works: IDENTIFIED WITH sha256_password BY 'imbatman' is the correct explicit syntax for naming a plugin - WITH <plugin> specifies the plugin, BY provides the cleartext password to hash.
Why the distractors fail:
- A -
IDENTIFIED AS ... WITH SHA256_PASSWORDreverses the correct keyword order and uses invalid syntax. - D - Completely inverted structure;
WITHbelongs afterIDENTIFIED, not afterCREATE USER. - E -
WITH mysql_native_passwordcontradicts the requirement to use SHA-256, and theUSING SHA256clause is not valid syntax. - F -
IDENTIFIED BY SHA256 AS 'imbatman'is not valid MySQL syntax;BYtakes a quoted string directly, not a keyword.
Memory tip: Think of it as "WITH the plugin, BY the password" - IDENTIFIED WITH <plugin> BY '<password>' is the explicit form, while IDENTIFIED BY '<password>' alone inherits the server default.
Topics
Community Discussion
No community discussion yet for this question.