MySQL needs to own its own directories, as it will be creating/deleting files within that directory. If the dir is owned by some other user ID, then mysql may fail because it can't do whatever file manipulations it needs. Once it has ownership of the directory, it's got carte-blanche.
The mysql user is an arbitrary choice. It could easily be 'fred' instead. But most people use mysql since that's the obvious choice. It's generally created by the package installers if you're installing a distro's pre-compiled version.
Mist 发行版的 MySQL 包将确保 mysql 用户(和组)存在。然后,如果您设置 MySQL 将其临时文件存储在 /data/tmp 中,您将希望它归 mysql:mysql 所有。只要 MySQL 需要使用临时表(以及其他一些情况),就会使用它。
Mist distributions's MySQL package will ensure the mysql user (and group) exists. Then, if you set up MySQL so it stores it's temporary files in /data/tmp, you'll want to have it owned by mysql:mysql. It will be used whenever MySQL requires use of a temporary table (amongst a few other cases).
发布评论
评论(3)
MySQL 需要拥有自己的目录,因为它将在该目录中创建/删除文件。如果该目录由其他用户 ID 拥有,那么 mysql 可能会失败,因为它无法执行所需的任何文件操作。一旦它拥有了目录的所有权,它就获得了全权委托。
mysql用户是任意选择的。它很容易被“fred”代替。但大多数人使用 mysql,因为这是显而易见的选择。如果您要安装发行版的预编译版本,它通常由软件包安装程序创建。
MySQL needs to own its own directories, as it will be creating/deleting files within that directory. If the dir is owned by some other user ID, then mysql may fail because it can't do whatever file manipulations it needs. Once it has ownership of the directory, it's got carte-blanche.
The mysql user is an arbitrary choice. It could easily be 'fred' instead. But most people use mysql since that's the obvious choice. It's generally created by the package installers if you're installing a distro's pre-compiled version.
Mist 发行版的 MySQL 包将确保 mysql 用户(和组)存在。然后,如果您设置 MySQL 将其临时文件存储在
/data/tmp
中,您将希望它归mysql:mysql
所有。只要 MySQL 需要使用临时表(以及其他一些情况),就会使用它。Mist distributions's MySQL package will ensure the
mysql
user (and group) exists. Then, if you set up MySQL so it stores it's temporary files in/data/tmp
, you'll want to have it owned bymysql:mysql
. It will be used whenever MySQL requires use of a temporary table (amongst a few other cases).对于问题2),如果您从源安装,则需要自己创建用户和组。来自 http://dev.mysql.com/doc/ refman/5.0/en/installing-source-distribution.html:
For question 2), If you are installing from source, you need to create the user and group yourself. From http://dev.mysql.com/doc/refman/5.0/en/installing-source-distribution.html :