You have to reset the password! steps for mac osx(tested and working) and Ubuntu
Stop MySQL
$ sudo /usr/local/mysql/support-files/mysql.server stop
Start mysql in safe mode:
$ sudo mysqld_safe –skip-grant-tables
(above line is one whole command)
This will be an ongoing command until the process is finished so open another shell/terminal window, log in without a password:
$ mysql -u root
Now:
mysql> UPDATE mysql.user SET Password=PASSWORD(‘password’) WHERE User=‘root’;
$ sudo /usr/local/mysql/support-files/mysql.server start
your new password is ‘password’.