1Z0-909 · Question #56
Examine this statement and output: What causes the error?
The correct answer is D. The database server process does not have sufficient privilege. Option D is correct because LOAD DATA INFILE causes the MySQL server process (typically running as the OS user mysql) to read the specified file directly from the server's filesystem. If the OS-level file permissions deny read access to that system user, MySQL throws an…
Question
Examine this statement and output:
What causes the error?
Options
- AThe engine is disabled.
- BThe set local_infile option has not been enabled.
- CThe database user does not have sufficient privilege.
- DThe database server process does not have sufficient privilege.
- EThe database client process does not have sufficient privilege.
- FThe database server is running in read-only mode.
How the community answered
(62 responses)- A3% (2)
- B13% (8)
- C2% (1)
- D76% (47)
- E2% (1)
- F5% (3)
Explanation
Option D is correct because LOAD DATA INFILE causes the MySQL server process (typically running as the OS user mysql) to read the specified file directly from the server's filesystem. If the OS-level file permissions deny read access to that system user, MySQL throws an OS-level "Permission denied" error (errno 13), regardless of what the SQL user is allowed to do.
Why the distractors are wrong:
- A - The storage engine has no bearing on the server's ability to read a file from the filesystem.
- B -
local_infileis only relevant forLOAD DATA **LOCAL** INFILE(client-side loading); a standardLOAD DATA INFILEdoesn't use it, and the error would explicitly mentionlocal_infilebeing disabled. - C - Insufficient SQL-level
FILEprivilege produces a MySQL access-denied error in the SQL layer, not an OS-level permission error; the error message wording is distinct. - E - The client process doesn't touch the file in non-LOCAL mode; only the server process reads it, so client OS permissions are irrelevant here.
- F - Read-only mode blocks
INSERT/UPDATE/DELETEon tables, not the act of the server reading a file from disk.
Memory tip: Ask yourself "Who physically opens the file?" - for LOAD DATA INFILE, it's the server daemon, so think server OS permissions, not SQL privileges or client permissions.
Topics
Community Discussion
No community discussion yet for this question.