Mysqladmin rejects password, mysql does not

Following the instructions in “Build your own database driven web site using PHP & MYSQL” I was able to install MYSQL, PHP, and Apache, although I did have to do the MYSQL installation twice. I did completely uninstall MYSQL and delete the MYSQL folder in Program Files and Program Data before reinstalling.

Now I can run mysql using:
mysql -p
and then enter the password I assigned when requested and use all the mysql commands.

However, when I run mysqladmin using:
mysqladmin -p xxxxx
and then enter the password I assigned when requested mysqladmin displays a couple of lines and then quits so fast it is impossible to read what it has printed.

xxxxx above can be any character string, but it must be entered or mysqladmin quits immediately.

Any ideas on why mysql works, but mysqladmin does not? How can I see what mysqladmin is printing when it quits?

I am using Vista Ultimate.

Thanks

Do you want to have access as a root? I guess you do, if you have not created any other user yet…

the instruction is mysql -u root -p (with mysqld or msyqlamdin should work too)

This means to open mysql as user (-u) root and ask for the password (-p)

Seems that you sorted it and figured it out. Good job :slight_smile:

I did as you suggested and got the following results when I ran cmd and then:

mysql

Error 1045 (28000): Access denied for user ‘ODBC’@‘localhost’ (using password: NO)
and then mysql terminated

when I ran cmd and then:

mysql -p

mysql asked for the password and then gave the same error as above with (using password: Yes)

When I run mysql or mysql -p directly from the Run window without running cmd both ask for the password and accept it.

When I run cmd and then:

mysqladmin
or
mysqladmin -p

I get what appears to be a rather long help listing and mysqladmin quits

When I run cmd and then:

mysqladmin -p xxx

I am asked for the password and when I enter it I get

connect to server at ‘localhost’ failed
error:Access denied for user ‘ODBC’@‘localhost’ (using password:YES)

Thanks

From the run command on the start menu run cmd and run mysql and/or mysqladmin from there. That way the window doesn’t vanish when the command ends and you could tell us what the actual error is. That would help :slight_smile:

I was in too big a hurry this morning trying to run the test and post the results and forgot the -u root.

With further testing I think I know where I went wrong.

When I run cmd and then type
mysqladmin -u root -p status

mysqladmin asks for the password and after I type it in it displays the status correctly and exits.

I was expecting mysqladmin to continue running until I tell it to exit, but after looking at the help screen it appears that input is strictly via the command line and that mysqladmin always exits after executing the command line. Is this true?

That would explain why
mysqladmin -u root
and
mysqladmin -u root -p
simply display the help screen since I didn’t ask it to do anything.

It also explains why
mysqladmin -u root -p xxx
asks for the password and then gives the error
unknown command ‘xxx’

Thanks for helping.