Apache Web-Serving With Mac OS X, Part 5
Subject:   didn't work for me...
Date:   2002-12-23 16:38:00
From:   csteinfield
Response to: password problem - just do the following...

I had the same problem, and was not sure if a password ever got set. I don't think so because it lets me enter the MySQL monitor without typing a password. I have tried typing:

/usr/local/bin/mysqladmin -u root password newpassword

and I get the following:
./bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: NO)'

An earlier post said that this command needed to be preceded with a sudo, so I tried the following:

su /usr/local/bin/mysqladmin -u root password newpassword

and then when prompted enter my normal login password (I am the admin user).

I then get the following error:

su: Sorry

Any idea what is going on? Thanks.

Full Threads Oldest First

Showing messages 1 through 4 of 4.

  • didn't work for me...
    2004-10-16 23:26:47 [View]

    Yep same exact problem going here with me as well. One quick and dirty way to connect to the MySQL server though is to modify the PHP script to

    $dbh = mysql_connect( "localhost", "localhost", "" ) or die("not happening");


    $dbh = mysql_connect( "localhost", "root", "" ) or die("not happening");

    Of course this doesn't address the core of the issue--setting the mysql root password however, it does allow you to play with php & mysql a bit.

    If your setup is purely for testing purposes only than having your system securely locked down perfect is a secondary issue. The more important thing is being able to check your code to ensure it works locally before uploading to the real web server where it matters.
  • didn't work for me...
    2003-07-22 18:18:30  anonymous2 [View]

    Same problem here. This is driving me NUTS. What am I doing wrong!?
    • didn't work for me...
      2003-08-03 03:30:06  anonymous2 [View]

      Same here.
      • This should work...
        2003-10-04 21:19:26  anonymous2 [View]

        First log into mysql, for me it's:

        sudo /usr/local/mysql/bin/mysql -p

        first you will be asked to enter your admin password, the one you use to install software. next you enter the current mysql root password.
        Then to change your password, enter:

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

        Where new_password is your new password...