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 /var/lib/mysql /data/mysql/
shell> chown –R mysql /data/mysql
What is the purpose of changing ownership of datadir to the ‘mysql’ user?
A. MySQL needs to be run as the root user, but files cannot be owned by it.
B. The mysqld process requires all permissions within datadir to be the same.
C. MySQL cannot be run as the root user.
D. MySQL requires correct file ownership while remaining secure.
Answer: D
Linux上安装的MySQL配置如下:
[mysqld]
user=mysql
datadir=/data/mysql/
然后你以root身份修改了datadir的路径和所有者信息:
shell> cp –R /var/lib/mysql /data/mysql/
shell> chown –R mysql /data/mysql
上述操作中修改datadir目录的所有者信息为”mysql”的目的是什么?
A. MySQL需要以root身份运行,但是文件不能属于root
B. mysqld进程需要datadir目录下的所有权限
C. MySQL不能以root身份运行
D. MySQL需要正确的所有者来确保安全
版权声明:本文为博主原创文章,未经博主允许不得转载。
MYSQL