Start mysql in safe mode: sudo mysqld_safe --skip-grant-tables
sudo mysqld_safe --skip-grant-tables
Connect to mysql database with mysql mysql
mysql
mysql mysql
Reset password with Update user Password = PASSWORD('root') where User = 'root' and HOST = 'loalhost';
Update user Password = PASSWORD('root') where User = 'root' and HOST = 'loalhost';