1Z0-908 practice question 11 of 25

MySQL programs look for option files in standard locations. Which method will show the option files and the order in which they are read?

Full set: 140 questions
Answer options
A: shell> mysqladmin --debug
B: shell> mysql --print-defaults
C: shell> mysqld --help --verbose Correct answer
D: mysql> SHOW GLOBAL VARIABLES;
Correct Answer:
C. shell> mysqld --help --verbose
Explanation

The command mysqld --help --verbose is the officially documented method to display the configuration that a MySQL program will use upon startup. It processes all standard option files in their default order of precedence and then prints a comprehensive list of variables, their values, and the specific file from which each setting was read. This output explicitly shows which option files were found and the order in which they were parsed, directly answering the question. The command prints this information and then exits without starting the server.

Why Incorrect

A. shell> mysqladmin --debug is used to generate a trace file for debugging the execution of the mysqladmin client, not for listing configuration files in their read order.
B. shell> mysql --print-defaults shows the final, consolidated set of options that the program would use, but it does not list the individual option files or the order they were read.
D. mysql> SHOW GLOBAL VARIABLES; is an SQL statement that displays the current values of server variables on a running instance, but it provides no information about their origin from configuration files.

References

1. MySQL 8.0 Reference Manual, Section 4.2.2.2, "Using Option Files": "To determine which option files a program reads, invoke it with the --help and --verbose options (for example, mysqld --help --verbose)." This directly confirms that option C is the correct method.

2. MySQL 8.0 Reference Manual, Section 4.3.1, "mysqld — The MySQL Server": The description for the --help (-?) and --verbose (-v) options explains that when used together, they display the server's configuration, including values from option files, and then exit.

3. MySQL 8.0 Reference Manual, Section 4.2.2.3, "Command-Line Options that Affect Option-File Handling": The documentation for --print-defaults states it causes the program to "print the program name and all options that it gets from option files." This clarifies that it shows the resulting options, not the source files.

Scroll to Top