On 14 Feb 2008, at 18:40, Jyri Virkki wrote:

> ludo wrote:
>>
>> # /usr/mysql/5.0/bin/mysqladmin -u root password root
>> /usr/mysql/5.0/bin/mysqladmin: connect to server at 'localhost'  
>> failed
>> error: 'Access denied for user 'root'@'localhost' (using password:  
>> NO)'
>
> Maybe I misunderstood the question, but seems you're trying to change
> the mysql 'root' users password again after having set it earlier?
> But, you're not authenticating when attempting to do it (now that
> there's a password set) so it won't let you.
>
> Try "mysqladmin -p -u root password root"

Yes, that's right :)

The argument following 'password' should be the password you want to  
use, i.e.:

mysqladmin -u root pasword "mypw"

If you've previously set the password, you need -p to be able to enter  
it to connect.

As part of a normal install you would do:

mysqladmin -u root password "pw"
mysqladmin -h localhost -p -u root password "pw"
mysqladmin -h hostname -u root password "pw"

You need -p on the second line because technically that's what you set  
on the first.

If you've forgotten your password, kill mysqld and then run  
mysqld_safe by hand with the --skip-grant-tables, connect (no password  
needed) and set the password, then shutdown and reboot.

MC


--
Martin 'MC' Brown, mc at mcslp.com
Everything MCslp: http://planet.mcslp.com




Reply via email to