Какое место по умолчанию занимает файл конфигурации MySQL на компьютере redhat linux?
Нужную вам информацию можно найти, выполнив
mysql --help
или
mysqld --help --verbose
Я попробовал это:
mysql --help | grep Default -A 1
И вывод:
(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
.
Параметры по умолчанию считываются из следующих файлов в заданном порядке:
/etc/mysql/my.cnf
/etc/my.cnf
~/.my.cnf
На резус-системы, конфигурационный файл MySQL находится в /etc/мой.КНФ по умолчанию.
Все они казались хорошими кандидатами:
/etc/my.cnf
/etc/mysql/my.cnf
/var/lib/mysql/my.cnf
...
во многих случаях вы могли бы просто проверить список процессов системы с использованием ПС:
server ~ # ps ax | grep '[m]ysqld'
Выход
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
Или
which mysqld
/usr/sbin/mysqld
Тогда
/usr/sbin/mysqld --verbose --help | grep -A 1 "Default options"
/etc/mysql/my.cnf ~/.my.cnf /usr/etc/my.cnf
Из заголовка ' файл/etc/mysql в/мой.КНФ':
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