authenticationsonarqube

Forgot sonarqube password. Using it locally, No Database


I am using sonarqube from command line. I have a local server (sonarqube 64) on my windows 7 (x86-64). I successfully installed and I can open the web host http://localhost:9000/. but I cannot login the admin/admin login details are not working.

I know there is way of resetting the password but I need database that I don't have and i am the only user/admin.

Is there any way to recover the password or change it? should I uninstall the server and install it again?

It is not said how to properly unistall the server either

Thanks


Solution

  • There is no real "installation" for SonarQube; you explode the zip and run one of the start scripts. So if you do decide to scrap your current instance, all you need to do is shut it down, delete the directory and re-explode the zip. However, once you do that, you should seriously consider connecting it to a production database. So far you're running with the embedded H2 database, and that's not appropriate for long-term use. Among other things, migration to new versions is not supported for the H2 database.

    Once you've done that, you can reset the admin password by executing the following query:

    update users set crypted_password = '88c991e39bb88b94178123a849606905ebf440f5', salt='6522f3c5007ae910ad690bb1bdbf264a34884c6d' where login = 'admin'
    

    That sets it back to 'admin'