On RH systems, MySQL configuration file is located under /etc/my.cnf by default.
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:
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
Just found it, it is /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
In the docker containers(centos based images) it is located at
/etc/mysql/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
In the docker containers(centos based images) it is located at
/etc/mysql/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:
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
Default options are read from the following files in the given order:
/etc/mysql/my.cnf
/etc/my.cnf
~/.my.cnf
On RH systems, MySQL configuration file is located under /etc/my.cnf by default.
Just found it, it is /etc/my.cnf
From the header of '/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
Default options are read from the following files in the given order:
/etc/mysql/my.cnf
/etc/my.cnf
~/.my.cnf
Just found it, it is /etc/my.cnf
From the header of '/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
it is located at /etc/mysql/my.cnf
Just found it, it is /etc/my.cnf
Source: Stackoverflow.com