Recover MySQL password
Lost your MySQL root password? No worries!
Stop MySQL server
# /etc/init.d/mysql stop
Start MySQL server without password
# mysqld_safe --skip-grant-tables &
Login
# mysql -u root
Change password
mysql> use mysql;
mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit
Stop and Start MySQL server
# /etc/init.d/mysql stop
# /etc/init.d/mysql start
Test to see if it works! (Should ask you for your new password)
# mysql -u root -p
Enjoy!