List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:October 10 1999 10:57am
Subject:Re: Access denied for user: 'root@localhost'...
View as plain text  
>>>>> "pnet" == pnet  <pnet@stripped> writes:

pnet> Thanks to sinisa@stripped who gave me hope and some insight into
pnet> fixing this problem.

pnet> I originally wrote about the error I was seeing:

pnet> #su mysql
pnet> $mysqladmin -u root password newpassword
pnet> mysqladmin: connect to server at 'localhost' failed
pnet> error: 'Access denied for user: 'root@localhost' (Using pasword: NO)'

pnet> After two days of mucking about, I finally fixed the problem.

pnet> I may have succeeded in changing the password the first time I tried it;
pnet> I'm nost sure. But in any case, after wiping out the grant tables and
pnet> re-creating them with mysql_install_db, I saw the following (again, logged
pnet> in as user 'mysql'):

pnet> $mysqladmin -u root password firstpassword
pnet> $mysqladmin -u root password secondpassword
pnet> mysqladmin: connect to server at 'localhost' failed
pnet> error: 'Access denied for user: 'root@localhost' (Using pasword: NO)'

This is ok.  The first row changes the password.  The second time
fails as you now have a password for root.

The following should have worked:

mysqladmin -u root password firstpassword
mysqladmin -u root -pfirstpassword password secondpassword

or

mysqladmin -u root password firstpassword
mysqladmin -u root --pasword=firstpassword password secondpassword

pnet> Notice that the first time, I saw no error message: the password was
pnet> succesfully changed to 'firstpassword'.

pnet> I tested this and found that I could login as root with:
pnet> $mysql -u root -p
pnet> Without using the -p option, I would just get "Access denied" message.


pnet> But the second time I tried to change the password, using the same command:
pnet> $mysqladmin -u root password secondpassword
pnet> I see the original error message.

pnet> NEW QUESTION:
pnet> Does anyone know how to change the root password once it has been initially
pnet> set?

See above.


Regards,
Monty
Thread
Access denied for user: 'root@localhost'...pnet6 Oct
  • Re: Access denied for user: 'root@localhost'...sinisa6 Oct
    • Re: Access denied for user: 'root@localhost'...pnet8 Oct
      • Re: Access denied for user: 'root@localhost'...Michael Widenius10 Oct