To reset MySQL password, you need to have root access to the machine. After logging in as root, start by shutting down MySQL:

$ /sbin/service mysqld stop

Verify that all mysql processes have been shut down.

$ ps waux | grep 'mysql'

For all processes that are listed

$ kill -9 <process-number>

Find your mysqld_safe.

$ locate mysqld_safe

My mysqld_safe is installed at /usr/bin/mysqld_safe. Yours might be elsewhere. Start MySQL without the grant tables.

$ /usr/bin/mysqld_safe --skip-grant-tables

At this point, you would need to open a new terminal.

$ locate mysql | grep 'bin/mysql'$

My mysql binary is located ate /usr/bin/mysql. Run mysql.

$ /usr/bin/mysql mysql

Update your root password

mysql> UPDATE user SET password=password('new-password') WHERE host='localhost' and user = 'root';

Log out of MySQL.

mysql> exit

Restart MySQL.

$ /sbin/service mysqld restart