Due to the way MySQL encrypts passwords it is not possible to recover one, There is however a way of resetting one. Here is how to do it for the root user…
at a command prompt type…
sudo service mysqld stopsudo mysqld_safe --skip-grant-tables &sudo mysql UPDATE mysql.user SET password=PASSWORD('new-password') WHERE user='root';FLUSH PRIVILEGES;EXIT;mysqladmin -u root -p shutdown sudo service mysqld startThat's all folks!