To further expand on the last answer below: if you look at the MANUAL that
comes in the DOC folder of the MySQL installation, section 6.16 "Causes of
Access Denied Errors":

'If you can't get your password to work, remember that you must use the
PASSWORD() function if you set the password with the INSERT, UPDATE, or SET
PASSWORD statements. The PASSWORD() function is unnecessary if you specify
the password using the GRANT ... INDENTIFIED BY statement or the mysqladmin
password command. See section 6.15 Setting Up Passwords. '

A sample would be:

insert into mysql.user
values('larry','root',password('larrys_password'),'Y','Y','Y',etc)

When you try to compare against the password field in mysql.user, the
password passed in is automatically encrypted and the encrypted value is
compared against whatever is in the mysql.password field. A more detailed
explanation is in section 6.15 "Setting Up Passwords" of the manual.

Hope that helps. Sorry if my answer was long and redundant, but I had this
same problem a while ago and it stressed me to the point where I don't want
anyone else to have to suffer it. :)

 - Adam


At 11:22 AM 7/19/2001 +0800, you wrote:

>This is actually a mysql question.  What you can do as follows:
>
>insert a row into mysql.user such that host = larry, user = root, password
= <encrypted pwd> (you can copy from the
>existing row -- localhost | root | ... )
>
>skc
>

Reply via email to