Women in Technology

Hear us Roar

  Apache Web-Serving With Mac OS X, Part 5
Subject:   change MySQL password in 10.2 ??
Date:   2002-12-01 11:36:32
From:   anonymous2
I had several of the problems reported in the previous comments. The socket problem and starting db problem I fixed by going to
and following the 10.2 procedure
except...when I got to the password section and entered the command into terminal, I got command not found.
It may be my syntax or path that is wrong. I am a newbie at both database and terminal. The fact that I have My SQL running and connected to Your SQL (no password) in only a few hours is amazing. Evidently the tutorial/ article is pretty good. :)
Thanks to Kevin H. and O Reilly
Any help with the password problem would be greatly appreciated. TIA
steve edge/ atlanta
Full Threads Oldest First

Showing messages 1 through 7 of 7.

  • change MySQL password in 10.2 ??
    2003-11-14 16:19:23  anonymous2 [View]

    I've found a solution to change password problem.
    First - if you specify a new user then by default the server name for this new user is by default '%' which should mean 'any' but doesn't work with 'localhost', so if you need to work with server at 'localhost' you need to create user for this server. This means that on the end I have two users in my 'mysql.user' table.
    User1: user_name@%
    User2: user_name@localhost

    In such a configuration the second user is used and is working correctly.

    The other problem is that SQL statement from manual for password change didn't work for me:

    UPDATE user SET Password=PASSWORD('123') WHERE user='user_name';

    I've found a second way to do it:

    set password for user_name@localhost = password('123');

    And it looks that the second statement works better.

  • password problem - just do the following...
    2002-12-10 18:20:37  tronje [View]

    type in the line like this:

    /usr/local/bin/mysqladmin -u root password ...(here comes your password)

    that's it.
    • didn't work for me...
      2002-12-23 16:38:00  csteinfield [View]

      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.
      • didn't work for me...
        2004-10-16 23:26:47  joe@collabornet.org [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");

        INSTEAD OF

        $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...