This post is older than a year. Consider some information might not be accurate anymore.
Start root access to mysql database
mysql -uroot -p
Check if sonar database exists.
show databases;
use sonar;
Reset admin user to admin password.
update users set crypted_password = '88c991e39bb88b94178123a849606905ebf440f5', salt='6522f3c5007ae910ad690bb1bdbf264a34884c6d' where login = 'admin';
Taken from SonarQube Confluence.