completely stop mysql server
sudo /usr/local/mysql/support-files/mysql.server stop
use sql with safe mode and change password
sudo mysqld_safe --skip-grant-tables &
log in
mysql -u root
use mysql;
update user set password=PASSWORD("xxxx") where User='root';
flush privileges;
quit
start mysql server
sudo /usr/local/mysql/support-files/mysql.server start
log in
mysql -u root -p
check users
select * from mysql.user;