1Z0-908 · Question #26
Examine these statements and output: Which statement is true?
The correct answer is D. The user is authorized as the rsmith@localhost user. Option D is correct because in MySQL, authorization refers to the account matched in the grant tables (shown by CURRENT_USER()), and the output would show CURRENT_USER() returning rsmith@localhost - meaning MySQL found an explicit rsmith@localhost entry and granted privileges…
Question
Examine these statements and output:
Which statement is true?
Exhibit
Options
- AThe user is logged in with --user=accounting as an option.
- BThe user is authenticated as the anonymous proxy user `'@'%'.
- CThe user is authorized as the accounting@localhost user.
- DThe user is authorized as the rsmith@localhost user.
- EThe user failed to define a username and the connecting username defaulted to `'@'%'.
How the community answered
(21 responses)- A5% (1)
- B10% (2)
- C5% (1)
- D81% (17)
Explanation
Option D is correct because in MySQL, authorization refers to the account matched in the grant tables (shown by CURRENT_USER()), and the output would show CURRENT_USER() returning rsmith@localhost - meaning MySQL found an explicit rsmith@localhost entry and granted privileges based on it.
Why each distractor is wrong:
- A is wrong because
--user=accountingis not a valid MySQL client flag syntax, and even if it were, that would describe the connecting username, not the authorized account. - B is wrong because the anonymous proxy account
''@'%'is only matched when no specific account is found - here, a valid named account was matched. - C is wrong because
accounting@localhostwould be the authorized account only if the grant tables matched that entry instead; the output indicatesrsmith@localhostwas the match. - E is wrong because a username was defined - the anonymous fallback
''@'%'only applies when no username is provided and no named match exists.
Memory tip: Think of MySQL authentication as two steps - who you say you are (USER()) vs. who MySQL says you are (CURRENT_USER()). "Authorized" questions always refer to the CURRENT_USER() result, i.e., the grant table match. If the output shows both functions returning the same value, the user connected and was matched under the same account.
Topics
Community Discussion
No community discussion yet for this question.
