sudo service mysql stop
sudo mysqld_safe --skip-grant-tables --skip-syslog --skip-networking
mysql -u root
UPDATE mysql.user SET authentication_string=PASSWORD('password') WHERE User='root';
FLUSH PRIVILEGES;
mysqladmin shutdown
sudo service mysql start