OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: secure automated access (was "Re: Backing up all databases")

From: Michael Stassen (Michael.Stassenverizon.net)
Date: Mon Nov 17 2003 - 10:51:47 CST


Ed Leafe wrote:

> On Monday, November 17, 2003, at 02:58 AM, Michael Stassen wrote:
>
>>> cat $HOME/.my.cnf
>>> [client]
>>> password="rootpassword"
>>> /usr/local/mysql/bin/mysql --defaults-file=$HOME/.my.cnf
>>> ERROR 1045: Access denied for user: 'rootlocalhost' (Using password:
>>> YES)
>>
>> Oh. That changes things. The error says "Using password: YES". (You
>> told me it said "Using password: NO" before). That would indicate
>> that mysql did read your .my.cnf file, but doesn't believe it contains
>> the correct password. Double-check you don't have a typo in there.
>> Another possibility might be a special character such as a " or # in
>> the password.
>
> There's the problem. Your original advice was to include:
>
>> In the case of root cron jobs then, you need a .my.cnf readable only by
>> root in root's home. It should include
>>
>> [client]
>> password="mysql_root_password"
>
>
> This is incorrect, unless the double quotes are part of the
> password. Removing them so that the entry reads:
>
> [client]
> password=mysql_root_password
>
> will correct the problem.
>

Randall Perry wrote:

> That was it. Thanks everyone for the help.

I'm glad this worked for you, but now I'm confused. The manual clearly
indicates the use of quotes around the password. See
<http://www.mysql.com/doc/en/Option_files.html>. The "typical user
option file" starts with

   [client]
   # The following password will be sent to all standard MySQL clients
   password="my_password"

On the same page it also says:

   option=value
       This is equivalent to --option=value on the command-line. Please
       note that you must quote an argument using double quotes, if the
       argument for an option contains a comment character.

(Comment characters are # and ;) My reading of this is that quotes,
though not always required, should always work. Furthermore, quotes are
required in certain circumstances (special characters in password).
This is how it works for me. I have quotes around my password in
.my.cnf, and it works. (No, my password doesn't contain quotes, though
I've tried a password that does contain a quote. It didn't make any
difference.) I can remove the quotes and it still works, so long as my
password doesn't contain a comment character.

On the other hand, Randall's problem was fixed by removing the quotes.
Perhaps a certain character (or characters) in a password make quotes
not work? If so, the manual should be fixed to reflect this.

Ed, you seem certain that quotes are incorrect, contrary to the manual.
    Perhaps you could elaborate?

Michael

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql