Where is the username and password stored for SQL Server database access?

Bill Hembree April 18, 2023

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

1 answer

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 18, 2023

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
Bill Hembree April 19, 2023

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.

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 19, 2023

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?

Bill Hembree April 19, 2023

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.

Bill Hembree April 19, 2023

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'. 

Bill Hembree April 19, 2023

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.

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 19, 2023

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

Bill Hembree April 20, 2023

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>


Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 20, 2023

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
Bill Hembree April 20, 2023

The correct confluence.cfg.xml file has been located. 

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 20, 2023

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.

Bill Hembree April 21, 2023

Thanks for your help

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events