SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Oct 2010
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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

  2. #2
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,095
    Mentioned
    153 Post(s)
    Tagged
    2 Thread(s)
    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
    Rémon - Hosting Advisor

    SitePoint forums will switch to Discourse soon! Make sure you're ready for it!

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  3. #3
    SitePoint Member
    Join Date
    Oct 2010
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

  4. #4
    #titanic {float:none} silver trophy
    molona's Avatar
    Join Date
    Feb 2005
    Location
    from Madrid to Heaven
    Posts
    8,259
    Mentioned
    245 Post(s)
    Tagged
    1 Thread(s)
    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)

  5. #5
    SitePoint Member
    Join Date
    Oct 2010
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  6. #6
    #titanic {float:none} silver trophy
    molona's Avatar
    Join Date
    Feb 2005
    Location
    from Madrid to Heaven
    Posts
    8,259
    Mentioned
    245 Post(s)
    Tagged
    1 Thread(s)
    Seems that you sorted it and figured it out. Good job


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •