Where do you see that?
I didn't type the command to execute the mysql client, and "database" is
not the password, is the default database of the session. So, in the command
mysql -u user -p database
the user is user, the password is prompted interactively, and the
default database is database. The command
mysql -u user -px xxxxxxx database
was not typed by me, I typed something like
mysql -u user -ppassword database
The difference to the above is that the password is in the command, and
is password.
Also, in the command that I said that I use to use in my scripts, the
password is "typed" with no space between password and the argument -p, like
mysql -u user -p`cat password_file` database
(It is a *nix systems only feature, at least in Linux)
Next time send to the list, also.
Dan Tappin wrote:
> You need to remove the space between -p and the password.
>
> Example:
>
> My user:pass is root:foobar
>
> So my command would be:
>
> mysql -u root -pfoobar
>
> NOT
>
> mysql -u root -p foobar
>
> Dan
>
> On Aug 1, 2005, at 9:09 AM, Nuno Pereira wrote:
>
>> Hello Edwin, Ehrwin,
>>
>> $ mysql --version
>> mysql Ver 14.7 Distrib 4.1.10a, for pc-linux-gnu (i686)
>>
>> I tried it several times, and the password always appears to me in like
>>
>> $ ps -ef | grep mysql
>> mysql -u user -px xxxxxxx database
>>
>> When I write the password interactively, no replaced password appears:
>>
>> $ ps -ef | grep mysql
>> mysql -u user -p database
>>
>>
>> The difference could be the version of the client (probably not the
>> server).
>>
>>
>> Edwin Cruz wrote:
>>
>>> Mhm....
>>> daemon2# uname -r -s
>>> FreeBSD 5.2.1-RELEASE
>>> daemon2# mysql --version
>>> mysql Ver 14.10 Distrib 5.0.6-beta, for unknown-freebsd5.2.1 (i386)
>>> using
>>> EditLine wrapper daemon2# mysql -utr8 -ptr8 &
>>> daemon2# ps -ef | grep mysql
>>> 230 p0- IL 0:00.01 /bin/sh /usr/local/bin/mysqld_safe
>>> --datadir=/var/lib/mysql
>>> 41064 p0 IL+ 0:00.02 mysql -h157.87.200.57 -utr8 -ptr8
>>> daemon2# mysql -utr8 -p &
>>> Enter password:
>>> daemon2# ps -ef | grep mysql
>>> 230 p0- IL 0:00.01 /bin/sh /usr/local/bin/mysqld_safe
>>> --datadir=/var/lib/mysql
>>> 41079 p0 SL+ 0:00.02 mysql -h157.87.200.57 -utr8 -p
>>> I can see my pwd if I do a "ps"
>>> -----Original Message-----
>>> From: Eugene Kosov [mailto:kea@stripped] Sent: Monday, August
>>> 01, 2005 7:03 AM
>>> To: Ehrwin Mina
>>> Cc: Nuno Pereira; mysql@stripped
>>> Subject: Re: mysql command line execution
>>> Ehrwin Mina wrote:
>>>
>>>>> That isn't true. If you make a ps, you will see something like
>>>>> "mysql -p x xxxxxxxx ................".
>>>>>
>>>>> As I said before, you can use something like:
>>>>> "mysql -uUser --password=`cat password_file` db"
>>>>>
>>>>>
>>>>
>>>> FYI,
>>>>
>>>> Nuno is correct you cannot see the password in the 'ps' and my
>>>> scripts is just an example you can modify it for more security like
>>>> putting it a config file or much better if you can use perl. Don't
>>>> forget the user privileges only.
>>>>
>>>>
>>> Hm... May be it's OS (or MySQL version) depending stuff but
>>> following shows
>>> me you're wrong.
>>> 1)
>>> > uname -r -s
>>> FreeBSD 5.3-RELEASE
>>> > mysql --version
>>> mysql Ver 14.7 Distrib 4.1.6-gamma-nightly-20041014, for unknown-
>>> freebsd5.3
>>> (i386)
>>> > mysql -ptest -utest &
>>> > ps | grep mysql
>>> 63841 p5 T 0:00,02 mysql -ptest -utest
>>> 2)
>>> > uname -r -s
>>> SunOS 5.9
>>> > mysql --version
>>> mysql Ver 14.11 Distrib 5.0.9-beta, for pc-solaris2.9 (i386) using
>>> readline
>>> 5.0
>>> > mysql -ptest -utest &
>>> > ps -ef | grep mysql | grep test
>>> kea 22646 22644 0 15:56:02 pts/4 0:00 mysql -piss_pwd -
>>> uiss_usr
>>>
>>
>> --
>> Nuno Pereira
>>
--
Nuno Pereira