Where is the username and password stored for SQL Server database access?
Asked by Bill Hembree:

confluence.cfg.xml does not show username and password for SQL Server database login.


Answers:
author: Nic Brough -Adaptavist-
body: Welcome to the Atlassian Community!

In most cases, it has to contain the database connection details, for Confluence to work. The exceptions are:

* The Confluence has been configured to use a local embedded database (h2, not suitable for a production server). You may find blank entries for username/password, or even missing lines in this case, depending on version.
* You have chosen to use JNDI in Tomcat instead of JDBC. You will find the database connection details in \<confluence installation directory\>/conf/server.xml See <https://confluence.atlassian.com/doc/configuring-a-datasource-connection-937166084.html>

comments: author: Bill Hembree
body: Confluence is working with a JDBC connection. Policies require the password to be changed every 60 days. Where is the password stored? If I change the password on the SQL Server user, I need to update it somewhere else so that the application can still log in to the database. The confluence.cfg.xml file does not show the current username and password that is in use, so I do not know where to update the password so the application works after changing the password.


author: Nic Brough -Adaptavist-
body: If you are using a JDBC connection, then the username, password, and connection string are in \<confluence home\>/confluence.cfg.xml

If you haven't got them in there, then you are not using a JDBC connection.

Could you be looking in a sample or copy of the confluence.cfg.xml?


author: Bill Hembree
body: I went to the confluence home directory and the confluence.cfg.xml file has none of our data in it. I don't know where else it could be.


author: Bill Hembree
body: I've searched the entire server, and there is only 1 confluence.cfg.xml file. We are using a JDBC connection that connects to a SQL Server database. The username we setup is 'confluenceuser', but the line in the xml file has the username as 'sa'.


author: Bill Hembree
body: in a related issue, we are also using jira, and I can't find the file where the jira username and password are stored either. There is not a dbconfig.xml file anywhere.


author: Nic Brough -Adaptavist-
body: So you do have a username set in the file, as I would expect from a JDBC connection. Could you show us the rest of the file? Please do obscure anything sensitive, we just need to see the raw XML and that any particular tag pair contains some data.

Jira won't work without a dbconfig.xml file in the home (data) directory, unless you've got a JNDI connection.l


author: Bill Hembree
body: Here are the contents of the file. This file is in the confluence home directory on the IIS server. I feel like this is not the correct file, but do not know where to look to find it. As stated before, this is the only confluence.cfg.xml file on the server.

```
<confluence-configuration>
     <setupStep>Complete</setupStep>
     <setupType>Install</setupType>
     <buildNumber>8803</buildNumber>
     <properties>
        <property name="access mode">READ_WRITE</property>
        <property name="admin.ui.allow.daily.backup.custom.location">false</property>
        <property name="admin.ui.allow.manual.backup.download">false</property>
        <property name="admin.ui.allow.site.support.email">false</property>
        <property name="atlassian.license.message">********</property>
        <property name="atlassian.license.message">********</property>
        <property name="attachments.dir">${confluenceHome}/attachments</property>
        <property name="confluence.setup.server.id">********</property>
        <property name="confluence.webapp.context.path">/confluence</property>
        <property name="finalizedBuildNumber">8803</property>
        <property name="hibernate.connection.autocommit">false</property>
        <property name="hibernate.connection.driver_class">org.h2.Driver</property>
        <property name="hibernate.connection.isolation">2</property>
        <property name="hibernate.connection.password"></property>
        <property name="hibernate.connection.provider_class">com.atlassian.confluence.impl.hibernate.DelegatingHikariConnectionProvider</property>
        <property name="hibernate.connection.username">sa</property>
        <property name="hibernate.database.lower_non_ascii_supported">true</property>
        <property name="hibernate.dialect">com.atlassian.confluence.impl.hibernate.dialectH2V4200Dialect</property>
?       <property name="hibernate.hikari.idleTimeout">30000</property>
        <property name="hibernate.hikari.maximumPoolSize">60</property>
        <property name="hibernate.hikari.minimumIdle">20</property>
        <property name="hibernate.hikari.registerMbeans">true</property>
        <property name="hibernate.setup">true</property>
        <property name="jwt.private.key">********</property>
        <property name="jwt.public.key">********</property>
        <property name="lucene.index.dir">${localHome}/index</property>
        <property name="spring.datasource.hikari.registerMbeans">true</property>
        <property name="synchrony.encryption.disabled">true</property>
        <property name="synchrony.proxy.enabled">true</property>
        <property name="webwork.multipart.saveDir">${localHome}/temp</property>
     </properties>
</confluence-configuration>


```


author: Nic Brough -Adaptavist-
body: Yep, that makes sense.

Your Confluence is not connected to an MS-SQL server, it is using the local embedded database.

The database driver is showing as "h2", with a username of "sa", which, by default, does not need a password.

```
name="hibernate.connection.driver_class">org.h2.Driver</property>
        <property name="hibernate.connection.isolation">2</property>
        <property name="hibernate.connection.password"></property>
        <property name="hibernate.connection.provider_class">com.atlassian.confluence.impl.hibernate.DelegatingHikariConnectionProvider</property>
        <property name="hibernate.connection.username">sa</property>
        <property 
```


author: Bill Hembree
body: The correct confluence.cfg.xml file has been located.


author: Nic Brough -Adaptavist-
body: Ahh, good! i was hoping that was the problem!

My usual trick is to forget that I, as a normal user, can't see everything another normal user (like the one running the Confluence service) can see.


author: Bill Hembree
body: Thanks for your help


Tags: confluence-server

server