nerdexam
Oracle

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…

Security

Question

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 you want to use the authentication plugin that implements SHA-256 hashing for user account passwords. Which two statements would create a user named webdesign for this IP address with the password of imbatman using a SHA_256 password hash?

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)
  • A
    4% (1)
  • B
    73% (19)
  • D
    8% (2)
  • E
    15% (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_PASSWORD reverses the correct keyword order and uses invalid syntax.
  • D - Completely inverted structure; WITH belongs after IDENTIFIED, not after CREATE USER.
  • E - WITH mysql_native_password contradicts the requirement to use SHA-256, and the USING SHA256 clause is not valid syntax.
  • F - IDENTIFIED BY SHA256 AS 'imbatman' is not valid MySQL syntax; BY takes 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

#authentication plugins#SHA-256 hashing#CREATE USER syntax#user management

Community Discussion

No community discussion yet for this question.

Full 1Z0-888 Practice