List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:March 17 2000 4:23pm
Subject:Re: getopt-bug in the cmd line tools
View as plain text  
At 5:06 PM +0100 03-17-2000, Tobiasb Brox wrote:
>>Description:
>
>It seems like it's not possible to set a password at the command line
>by using `-p passwd', while `--password=passwd' works.

If you use -p, there cannot be a space between -p and the password.
Use -ppasswd instead.

This is not a bug.  -p with no immediately following string in the word
is intended to cause client programs to prompt you interactively for
the password, just as --password with no immediately following =passwd
does.


>
>>How-To-Repeat:
>
>$ mysql -p jfowewijf
>Enter password:
>ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)
>
>$ mysql --password=sdffwe
>ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES)
>
>$ mysql -h fjoewij
>ERROR 2005: Unknown MySQL Server Host 'asdfwfewe' (2)
>
>$ mysql --host=feww
>ERROR 2005: Unknown MySQL Server Host 'feww' (2)
>
>>Fix:
>
>Of course it's quite easy to use --password instead of -p.  Anyway, it
>is actually a bug :) We were having a script where we used the
>construct "-p $passwd" - if $passwd were set, it was used, if not, the
>password would be asked for interactively, which was pretty much the
>wanted behaviour. `--password=' behaves differently from `-p '. Well,
>the script should be done more robust anyway ... I'll make a
>work-around with an if ... :)
>
>>Submitter-Id:	TobiX
>>Originator:	tobiasb@stripped
>>Organization:
>http://www.funcom.com/
>>MySQL support: [none | licence | email support | extended email support ]
>none
>>Synopsis:	Command line option -p doesn't accept a parameter
>>Severity:	non-critical
>>Priority:	low
>>Category:	mysql
>>Class:		sw-bug
>>Release:	mysql-3.23.6-alpha (Source distribution)
>>Server: /usr/local/bin/mysqladmin  Ver 7.12 Distrib 3.23.6-alpha, 
>>for pc-linux-gnu on i686
>TCX Datakonsult AB, by Monty
>
>Server version		3.23.6-alpha-log
>Protocol version	10
>Connection		Localhost via UNIX socket
>UNIX socket		/tmp/mysql.sock
>Uptime:			25 days 3 hours 35 min 55 sec
>
>Threads: 1  Questions: 20280  Slow queries: 0  Opens: 920  Flush 
>tables: 2  Open tables: 41
>>Environment:
>
>System: Linux tobserve 2.2.12-20 #1 Mon Sep 27 10:40:35 EDT 1999 i686 unknown
>Architecture: i686
>
>Some paths:  /usr/bin/perl /usr/bin/make /usr/bin/gmake /usr/bin/gcc 
>/usr/bin/cc
>GCC: Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs
>gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
>Compilation info: CC='gcc'  CFLAGS=''  CXX='c++'  CXXFLAGS=''  LDFLAGS=''
>LIBC:
>lrwxrwxrwx   1 root     root           13 Nov  9 18:54 
>/lib/libc.so.6 -> libc-2.1.2.so
>-rwxr-xr-x   1 root     root      4118299 Sep 20 11:12 /lib/libc-2.1.2.so
>-rw-r--r--   1 root     root     20020054 Sep 20 11:12 /usr/lib/libc.a
>-rw-r--r--   1 root     root          178 Sep 20 11:12 /usr/lib/libc.so
>Configure command: ./configure  --prefix=/usr/local
>Perl: This is perl, version 5.004_04 built for i386-linux
>

-- 
Paul DuBois, paul@stripped
Thread
getopt-bug in the cmd line toolsTobiasb Brox17 Mar
  • Re: getopt-bug in the cmd line toolsPaul DuBois17 Mar
    • Re: getopt-bug in the cmd line toolsTobias Brox17 Mar
      • Re: getopt-bug in the cmd line toolsThimble Smith17 Mar