1Z0-888 · Question #29
MYSQL is installed on a Linux server and has this configuration: [mysqld] user=mysql datadir=/data/mysql/ As the 'root' user, you change the datadir location by executing: shell> cp -R…
The correct answer is D. MySQL requires correct file ownership while remaining secure. MySQL runs as the unprivileged mysql OS user (not root) for security isolation - if the process were ever compromised, an attacker would only gain mysql-level access rather than full system control. D is correct because chown -R mysql /data/mysql gives the mysql process the…
Question
Options
- AA MySQL needs to be run as the root user, but files cannot be owned by it.
- BThe MySQL process requires all permissions within datadir to be the same.
- CMySQL cannot be run as the root user.
- DMySQL requires correct file ownership while remaining secure.
How the community answered
(31 responses)- A3% (1)
- B3% (1)
- C10% (3)
- D84% (26)
Explanation
MySQL runs as the unprivileged mysql OS user (not root) for security isolation - if the process were ever compromised, an attacker would only gain mysql-level access rather than full system control. D is correct because chown -R mysql /data/mysql gives the mysql process the ownership it needs to read, write, and create files in the new datadir, while keeping those files inaccessible to other unprivileged users.
Why the distractors fail:
- A is backwards - MySQL cannot run as root by default (it actively refuses), so root ownership of the files would break it, not help it.
- B is a red herring - MySQL doesn't require uniform permissions across all files; it requires correct ownership on the right directories.
- C is a true statement in isolation, but it describes a constraint on the process, not the purpose of the
chowncommand - it doesn't explain why the ownership change is needed.
Memory tip: Think of it as "least privilege + functionality" - MySQL is intentionally denied root to stay secure, so its data files must be owned by the same mysql user it runs as, or it simply can't do its job. The chown command bridges security policy and operational need.
Topics
Community Discussion
No community discussion yet for this question.