I Forgot password of local confluence
Asked by Daria Gorbacheva:

Hello,

I installed the confluence as trial version on my local computer a week ago. I'm only one user and I'm administrator of confluence. But I forgot my password. How can I get a new password for my local confluence?

Thank you


Answers:
author: Andrew Frayling
body: Hi Daria,

You could try changing the password directly in the database, instructions available at <http://confluence.atlassian.com/display/DOC/Restoring+Passwords+To+Recover+Admin+User+Rights>

Andrew.

comments: author: Daria Gorbacheva
body: Hi Andrew!

Thank you veru much for this answer. But I still hava a problem:

There is no "database" folder in \<confluence-home-directory\>. Ande I know how to use the database for chenge my password. Maybe I need one more installation confluence ubove this?

Thank you


author: Andrew Frayling
body: Hi Daria,

Just double-checking you are using the embedded HSQL database rather than an external database such as MySQL, Postgres, etc. and you're checking in the \<confluence home\> directory (<http://confluence.atlassian.com/display/DOC/Confluence+Home+Directory>) and not the \<confluence installation\> directory (<http://confluence.atlassian.com/display/DOC/Confluence+Installation+Directory>)?

If you're not using HSQL then the SQL to reset the password would need to be run against the database that you are using.

If you are using HSQL then an alternative way of accessing the database is to use HSQL's Database Manager (<http://confluence.atlassian.com/display/JIRA/Running+SQL+commands+in+a+HSQL+database>) - those instructions are for JIRA, but the steps are the same for Confluence:

1. Shutdown Confluence  
2. Locate the HSQL JAR file (in my Confluence 4.1.4 installation it's \<confluence installation\>/WEB-INF/lib/hsqldb-2.2.4.jar  
3. From a command line run java -cp ./hsqldb-2.2.4.jar org.hsqldb.util.DatabaseManager -user sa -url jdbc:hsqldb:\<confluence home\>/database/confluencedb;hsqldb.tx=MVCC   
4. Execute the relevant SQL in the HSQL Database Manager GUI  
5. Exit the Database Manager  
6. Start Confluence

If none of the above works then you're probably looking at recovering from backup (if you have one) or uninstalling and re-installing from scratch. Depending on how much work you would lose if you had to re-install from scratch a re-install may be less effort than resetting the admin password?

Does that help?

Andrew.


author: Calogero Bonasia
body: "Running SQL commands in a HSQL database" --\> page deleted ... :-(


author: hsuhailah
body: You can also refer to this:

##### For the Evaluation Embedded HSQL Database {#toc-hId-1084628901}

To change the password to admin for a given username:

1. Shut down Confluence.
2. Open \<confluence-home\>/database/confluencedb.script, or confluencedb.log if the .script file looks empty.
3. Search for:  

   ```
   INSERT INTO CWD_USER VALUES(
   ```

   Keep searching until you find the appropriate user, then replace their password with this hash value:  

   ```
   x61Ey612Kl2gpFL56FT9weDnpSo4AV8j8+qx2AuTHdRyY036xxzTTrw10Wq3+4qQyB+XURPWx1ONxp3Y3pB37A==
   ```

4. Save the file.
5. Restart Confluence.

FYI, Confluence Home folder is defined in \<Confluence install folder\>/confluence/WEB-INF/classes/confluence-init.properties file.

comments: author: Richard Cross
body: Note that the above does not work in recent versions of Confluence, as the H2 database is in a binary file.