Bug #30970 errors in my.cnf should not affect --help or --version
Submitted: 12 Sep 2007 11:11 Modified: 12 Sep 2007 11:18
Reporter: Hartmut Holzgraefe Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: General Severity:S3 (Non-critical)
Version:5.0, 5.1, actually all OS:Any
Assigned to: Assigned Account CPU Architecture:Any
Tags: Options, usability
Triage: Triaged: D4 (Minor)

[12 Sep 2007 11:11] Hartmut Holzgraefe
Description:
An error in my.cnf does also prevent getting --help or --version information from the affected binary.

I first stumbled into this yesterday after a partially failed debian upgrade,
mysqld on startup complained about old-passwords being an unknown option.

So i wanted to verify which version this mysqld was and whether it really
didn't support that option or whether there was just a typo in it, e.g.
the real name being "old-password" without the plural 's'

So i tried both "mysqld --version" and "mysqld --help" to get the wanted information, but both just failed with

  mysqld: unknown variable 'old-passwords'

How to repeat:
Add a nonexisting variable in my.cnf, then try to get help or version information from the affected binary. A typical example:

  [client]
  database=test

Now try to run "mysqladmin" ... unlike most other client binaries mysqladmin doesn't have a "database" option, so this fails:

  $ mysqladmin ping
  mysqladmin: unknown variable 'database=test'

  $ mysqladmin --help
  mysqladmin: unknown variable 'database=test'

  $ mysqladmin --version
  mysqladmin: unknown variable 'database=test'

Suggested fix:
Invalid configuration file entries should *not* prevent the execution of --help or --version.

--version should not be affected at all

--help output often contains information on current default settings 
so reading the option file is required in these cases. An error message
should only be printed when reaching this part of the help output though
*after* printing the useage information.
[12 Sep 2007 11:18] Miguel Solorzano
Thank you for the bug report.
[3 Oct 2007 14:35] Miguel Solorzano
Bug: http://bugs.mysql.com/bug.php?id=31370 was marked as duplicate of
this one.
[14 Sep 2010 22:55] Sveta Smirnova
Bug #56779 was marked as duplicate of this one.
[14 Sep 2010 22:56] Sveta Smirnova
Most likely duplicate of bug #30025
[30 Sep 2016 11:45] Daniël van Eeden
> Most likely duplicate of bug #30025
I don't think so.

Verified on 8.0.0
[30 Sep 2016 11:46] Daniël van Eeden
If loose_database is used instead of database in the client section 'mysqladmin ping' does work but returns a warning.