Bug #106557 Default options my.cnf file order
Submitted: 24 Feb 2022 10:13 Modified: 24 Feb 2022 14:33
Reporter: bin wang (OCA) Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:Ver 8.0.28 OS:Any
Assigned to: CPU Architecture:Any

[24 Feb 2022 10:13] bin wang
Description:
./mysqldump  --help
mysqldump  Ver 8.0.28 for Linux on x86_64 (Source distribution)
.............................
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /etc/mysql8/my.cnf ~/.my.cnf 
...........................
but in mysql-server/mysys/my_default.cc is 

"
1406     default_paths["/etc/my.cnf"] = enum_variable_source::GLOBAL;
         default_paths["/etc/mysql/my.cnf"] = enum_variable_source::GLOBAL;
     default_paths[string(buffer) + ".my.cnf"] = enum_variable_source::MYSQL_USER;
"
missing  file  in  /etc/mysql8/my.cnf

How to repeat:

need  add default file path   /etc/mysql8/my.cn
      mysql-server/mysys/my_default.cc is 

"
1406  default_paths["/etc/my.cnf"] = enum_variable_source::GLOBAL;
  default_paths["/etc/mysql/my.cnf"] = enum_variable_source::GLOBAL;
 ++ default_paths["/etc/mysql8/my.cnf"] = enum_variable_source::GLOBAL;
  default_paths[string(buffer) + ".my.cnf"] = enum_variable_source::MYSQL_USER;
"
[24 Feb 2022 10:25] bin wang
suggested fix patch

Attachment: mysql.patch (application/octet-stream, text), 620 bytes.

[24 Feb 2022 10:32] Terje Røsten
The /etc/mysql8/my.cnf is coming from --basedir option.

Please see:

 https://dev.mysql.com/doc/refman/8.0/en/option-files.html

Patch is not correct.
[24 Feb 2022 14:33] MySQL Verification Team
Hi Mr. wang,

Thank you for your bug report.

However, base direcotry or `basedir` is one of the valid options for the configuration file.

Not a bug.