[英]MySQL config file location - redhat linux server
Redhat linux机器上MySQL配置文件的默认位置是什么?
刚发现它是/etc/my.cnf
The information you want can be found by running 您可以通过运行找到所需的信息
mysql --help
or 要么
mysqld --help --verbose
I tried this : 我尝试了这个:
mysql --help | grep Default -A 1
And the output: 并输出:
(Defaults to on; use --skip-auto-rehash to disable.)
-A, --no-auto-rehash
--
(Defaults to on; use --skip-line-numbers to disable.)
-L, --skip-line-numbers
--
(Defaults to on; use --skip-column-names to disable.)
-N, --skip-column-names
--
(Defaults to on; use --skip-reconnect to disable.)
-s, --silent Be more silent. Print results with a tab as separator,
--
--default-auth=name Default authentication client-side plugin to use.
--binary-mode By default, ASCII '\0' is disallowed and '\r\n' is
--
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf
它位于/etc/mysql/my.cnf
Default options are read from the following files in the given order: 从以下文件中以给定顺序读取默认选项:
/etc/mysql/my.cnf
/etc/my.cnf
~/.my.cnf
在RH系统上,默认情况下,MySQL配置文件位于/etc/my.cnf下。
All of them seemed good candidates: 他们似乎都是不错的候选人:
/etc/my.cnf
/etc/mysql/my.cnf
/var/lib/mysql/my.cnf
...
in many cases you could simply check system process list using ps: 在许多情况下,您可以简单地使用ps检查系统进程列表:
server ~ # ps ax | grep '[m]ysqld'
Output 输出量
10801 ? Ssl 0:27 /usr/sbin/mysqld --defaults-file=/etc/mysql/my.cnf --basedir=/usr --datadir=/var/lib/mysql --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock
Or 要么
which mysqld
/usr/sbin/mysqld
Then 然后
/usr/sbin/mysqld --verbose --help | grep -A 1 "Default options"
/etc/mysql/my.cnf ~/.my.cnf /usr/etc/my.cnf
From the header of '/etc/mysql/my.cnf': 从“ /etc/mysql/my.cnf”的头中:
MariaDB programs look for option files in a set of
locations which depend on the deployment platform.
[...] For information about these locations, do:
'my_print_defaults --help' and see what is printed under
"Default options are read from the following files in the given order:"
More information at: http://dev.mysql.com/doc/mysql/en/option-files.html
In the docker containers(centos based images) it is located at 在docker容器(基于centos的图像)中,它位于
/etc/mysql/my.cnf /etc/mysql/my.cnf
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.