my_print_defaults
my_print_defaultsoptionsfilename
This utility parses a configuration file, converting key/value
pairs into command-line equivalent options. For instance, a line from
the my.cnf file that reads
basedir=/data/mysql will be converted to
--basedir=/data/mysql. To export the MySQL daemon
(i.e., mysqld) section of
my.cnf file, enter the following from the command
line (the output follows):
my_print_defaults --config-file=/etc/my.cnf mysqld --basedir=/data/mysql --datadir=/data/mysql --socket=/tmp/mysql.sock --tmpdir=/tmp --log-bin=/data/mysql/logs/log-bin
Notice that only the mysqld section is parsed
and that the header [mysqld] and the blank lines are
not included in the output. Also, each key/value pair is printed on a
separate line. To parse more than one section, you can list additional
section names at the end of the command line, separated by
spaces.
Here is a list of options available for this utility in alphabetical order:
--config-file=filename,
--defaults-file=filename, -c
filenameThis option instructs the utility to read only the given configuration or options file (i.e., my.cnf or my.ini).
--debug[=options], -#
[options]This option logs debugging information. The set of options
used by default is 'd:t:o,logname'. See Table 16-1 at the end of the list of
options under the mysqldump utility for an
explanation of these flags and others that may be used.
--defaults-extra-file=filename,
--extra-file=filename, -e
filenameThis option instructs the utility to read the given configuration or options file in addition to the default options file (i.e., my.cnf or my.ini).
--defaults-group-suffix=suffix,
-g suffixThis option instructs the utility to read the options for
the groups with the given suffix (e.g.,
_clients).
--help, -?This option displays basic help information.
--no-defaults, -nThis option indicates that no options file should be used.
--verbose, -vThis option displays more information from the utility.
--version, -VThis option returns the version of the utility.