Women in Technology

Hear us Roar



Article:
  Apache Web-Serving With Mac OS X, Part 5
Subject:   change MySQL password in 10.2 ??
Date:   2003-11-14 16:19:23
From:   anonymous2
Response to: change MySQL password in 10.2 ??

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.


PiotrL