添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
I recently had some difficulty with the --defaults-extra-file flag so
I thought I'd share my experiences and point out an area where the
documentation can be improved. All of the following pertains to MySQL
5.0.45

I wanted to avoid putting my password on the command line so I read
the mysql(1) man page regarding the --password flag. It refers me to
6.6, "Keeping Your Password Secure". Section 6.6 is actually, "Disk
Issues" so I turn to section 5.8.6 and get to "Keeping Your Password
Secure". [1] After reading this section, I decide that I'd like to
use an option file to store my password and pass the name of the
option file on the command line. I turn to section 4.3.2, "Using
Option Files" which introduces me to the --defaults-extra-file. Here
are some command lines.

Original Command Line
mysql --user=user --password=password ...

New Command Line (after reading 4.3.2)
mysql --user=user --defaults-extra-file=mysql.cnf ...

The first command works and the second gives me this error.

mysql: unknown variable 'defaults-extra-file=mysql.cnf' [2]

I pore through the manual looking for clues to no avail. I read the
man page for mysql and it doesn't even mention the flag. [3] I try
`mysql -?` but my shell expands the ? and I get an error. mysql --
help finally leads me to the answer when it lists --defaults-extra-
file under the heading, "The following options may be given as the
first argument:". Now my command line looks like this and it works.

mysql --defaults-extra-file=mysql.cnf --user=user ...

This working command is astonishingly similar to the command which
gives an error. I have two nagging questions.

- Why must this flag be first on the command line?
- Why is this not documented in section 4.3.2? [4]

The following requests are addressed to a steward of the MySQL product
if one is listening.

[1] - Please update the man page near the description for --password,
replacing 6.6 with 5.8.6 to correct the section number for "Keeping
Your Password Secure".

[2] - Please add a more descriptive error message indicating that the
--defaults-extra-file flag must be first when displaying the error
message, "mysql: unknown variable 'defaults-extra-file=arg'".

[3] - Please add --defaults-extra-file to the man page.

[4] - Please add the the necessity for --defaults-extra-file to be
first to section 4.3.2 of the manual.

Ken Smith
Post by Captain Paralytic
I suspect it then allows one to override any settings in the file with
options on the command line (last in gets used).
I can totally see that but that doesn't make it necessary for this
flag to be first. The mysql command line requires it to be first.
And, even if it does need to be first, at least tell me that when the
command fails to run because the parameter isn't first on the line.
Post by Ken
Post by Ken
not documented in section 4.3.2? [4]
I suspect it then allows one to override any settings in the file with
options on the command line (last in gets used).
I can totally see that but that doesn't make it necessary for this
flag to be first. The mysql command line requires it to be first.
And, even if it does need to be first, at least tell me that when the
command fails to run because the parameter isn't first on the line.
Well you can always demand your money back.
Post by Paul Lautman
Post by Ken
Post by Ken
not documented in section 4.3.2? [4]
I suspect it then allows one to override any settings in the file with
options on the command line (last in gets used).
I can totally see that but that doesn't make it necessary for this
flag to be first. The mysql command line requires it to be first.
And, even if it does need to be first, at least tell me that when the
command fails to run because the parameter isn't first on the line.
Well you can always demand your money back.
Indeed. I'm not asking for help here. I'm trying to point out an
area where the documentation can be improved and am providing specific
data. Your response is not well intended and is not useful.

replies i stopped paying for my house in june 08. the house went into forclosure and i went bankrupt, and had a disch? started 2009-03-01 17:58:27 UTC replies I'm just about to install Ubuntu and would like to ask about extra software installation? started 2011-02-04 21:11:00 UTC