SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    Bimbo With A Brain! silver trophy Saz's Avatar
    Join Date
    Mar 2001
    Location
    Kent, United Kingdom
    Posts
    5,275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy MySql password not being recognised

    This is totally new ground for me and I'm probably going to make a complete idiot of myself asking this, but I can't for the life of me work out what I'm doing wrong so I need help.

    To put everyone in the picture, I've just started working my way through Kevin Yank's book. So far I have downloaded and installed MySql version 4.0.12-win, php version 4.3.1-Win32 and Apache version 1.3.27-win32.

    Everything appears to be installed ok as I was able to get the first php script in the book (today.php at the end of Chapter 1) to work in the localhost directory. I can also get into MySql and tell it to Show Databases just fine.

    The problem is with setting the password for MySql. For some reason it just won't accept it.

    If I run the sequence shown in "Post Installation Setup Tasks", I get the following:
    C:\mysql\bin>mysqladmin -u root password "mypassword"
    C:\mysql\bin>mysqladmin -u root reload
    C:\mysql\bin>mysqladmin -u root -p status
    Enter password: **********
    C:\MYSQL\BIN\MYSQLA~1.EXE: connect to server at 'localhost' failed
    error: 'Access denied for user: 'root@127.0.0.1' (Using password: YES)'
    I get this error every time I give the password, but if I run the status command and don't type a password, it lets me in!
    C:\mysql\bin>mysqladmin -u root -p status
    Enter password:
    Uptime: 9406 Threads: 1 Questions: 13 Slow queries: 0 Opens: 16 Flush tables: 1 Open tables: 0 Queries per second avg: 0.001
    C:\mysql\bin>
    If I actually try to log into MySql, following the instructions given in Chapter 2, this happens:
    C:\mysql\bin>mysql -h localhost -u root -p
    Enter password: **********
    ERROR 1045: Access denied for user: 'root@127.0.0.1' (Using password: YES)
    C:\mysql\bin>
    But if I don't type a password, it logs me in!
    C:\mysql\bin>mysql -h localhost -u root -p
    Enter password:
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 7 to server version: 4.0.12
    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
    mysql>
    Can somebody please explain what I'm doing wrong because as far as I can see I'm following the intructions in the book to the letter.

    If it makes a difference, I'm running Window ME and made sure I followed the instructions for it.
    Saz: Naturally Blonde, Naturally Dizzy!
    No longer Editor of the Community Crier.

    Don't mind me, I'm having a BLONDE moment!

  2. #2
    Bimbo With A Brain! silver trophy Saz's Avatar
    Join Date
    Mar 2001
    Location
    Kent, United Kingdom
    Posts
    5,275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've found this on the MySql website but it's absolute gobble-di-gook to me because it bares no resemblance to anything that's in Kev's book.
    Saz: Naturally Blonde, Naturally Dizzy!
    No longer Editor of the Community Crier.

    Don't mind me, I'm having a BLONDE moment!

  3. #3
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Give this a try:

    C:\mysql\bin>mysql -u root mysql

    then:

    SET PASSWORD FOR root@localhost=PASSWORD('new_password');

    http://www.mysql.com/doc/en/Default_privileges.html

    BTW - there's a program called winmysqladmin in the bin folder that should ask what you want to set the root password to when you first run it

    Good luck!

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  4. #4
    Bimbo With A Brain! silver trophy Saz's Avatar
    Join Date
    Mar 2001
    Location
    Kent, United Kingdom
    Posts
    5,275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    YES!!!!! Sean, I love you!
    Saz: Naturally Blonde, Naturally Dizzy!
    No longer Editor of the Community Crier.

    Don't mind me, I'm having a BLONDE moment!

  5. #5
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Glad it's working

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature


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
  •