Connecting Jira applications to SQL Server 2019

These instructions will help you connect Jira to a Microsoft SQL Server 2019 database.

Before you begin

1. Create and configure the SQL Server database

When creating the database, remember your database name, user name, schema name, and port number, because you'll need them later to connect Jira to your database.

  1. Create a database for Jira (e.g. jiradb). 

    • Make sure the collation type is case-insensitive.

      Supported collation types...

      We support SQL_Latin1_General_CP437_CI_AI and Latin1_General_CI_AI as case-insensitive, accent-insensitive, and language neutral collation types. If your SQL Server installation's collation type settings have not been changed from their defaults, check the collation type settings.

    • SQL Server uses Unicode encoding to store characters. This is sufficient to prevent any possible encoding problems.

  2. Create a database user which Jira will connect as (e.g. jiradbuser). This user should not be the database owner, but should be in the db_owner role.

  3. Create an empty 'schema' in the database for the Jira tables (e.g. jiraschema).

    Tell me more...

    A 'schema' in SQL Server 2019 is a distinct namespace used to contain objects and is different from a traditional database schema. You are not required to create any of Jira's tables, fields or relationships (Jira will create these objects in your empty schema when it starts for the first time). You can read more on SQL Server 2019 schemas in the relevant Microsoft documentation.

  4. Make sure that the database user has permission to connect to the database, and to create and populate tables in the newly-created schema.

  5. Make sure that TCP/IP is enabled on SQL Server and is listening on the correct port. A default SQL Server installation uses port number 1433.
  6. Make sure that SQL Server is operating in the appropriate authentication mode.

    Tell me more...

    By default, SQL Server operates in 'Windows Authentication Mode'. However, if your user is not associated with a trusted SQL connection, i.e. 'Microsoft SQL Server, Error: 18452' is received during Jira startup, you will need to change the authentication mode to 'Mixed Authentication Mode'. Read the Microsoft documentation on authentication modes and changing the authentication mode to 'Mixed Authentication Mode'

  7. Turn off the SET NOCOUNT option.
    1. Open SQL Server Management Studio.
    2. Go to Tools > Options > Query Execution > SQL Server > Advanced, and clear the SET NOCOUNT check box.
      SET NOCOUNT option in SQL Server Management Studio.

    3. Right-click your server in the Object Explorer, and go to Properties > Connections > Default Connections. Clear the no count option.

  8. Access the Query Console by right clicking on the newly created database and selecting 'New Query'. Run the following command to set the isolation level.


2. Configure Jira to connect to the database

There are two ways to configure your Jira server to connect to your SQL Server database.

Database connection fields

The table shows the fields you'll need to fill out when connecting Jira to your database. You can also refer to them, and the sample dbconfig.xml file below, if you'd like to create or edit the dbconfig.xml file manually.

Setup wizard / Configuration tooldbconfig.xmlDescription

Located in the <url> tag (bold text in example below): <url>jdbc:sqlserver://dbserver :1433;databaseName=jiradb</url>

The name or IP address of the machine that the SQL Server server is installed on.

Located in the <url> tag (bold text in example below):
<url>jdbc:sqlserver://dbserver :1433;databaseName=jiradb</url>

The TCP/IP port that the SQL Server server is listening on. You can leave this blank to use the default port.

Located in the <url> tag (bold text in example below):
<url>jdbc:sqlserver://dbserver :1433;databaseName=jiradb</url>

The name of your SQL Server database (into which Jira will save its data). You should have created this in Step 1 above.

Located in the <username> tag (see bold text in example below):
<username> jiradbuser </username>

The user that Jira uses to connect to the SQL Server server. You should have created this in Step 1 above.
PasswordLocated in the <password> tag (see bold text in example below):
<password> jiradbuser </password>
The user's password — used to authenticate with the SQL Server server.
SchemaLocated in the <schema-name> tag (see bold text in example below):
<schema-name> dbo </schema-name>

The name of the schema that your SQL Server database uses. You should have created this in Step 1 above.

Sample dbconfig.xml file

For more information about the child elements of <jdbc-datasource/> beginning with pool in the dbconfig.xml file above, see Tuning database connections.

  <validation-query>select 1</validation-query>


Both the Jira setup wizard and database configuration tool also add the element <validation-query>select 1</validation-query> to the dbconfig.xml file, which is usually required when running Jira with default MySQL installations. See Surviving connection closures for details.

3. Start Jira

You should now have Jira configured to connect to your SQL Server database. The next step is to start it up!

Last modified on Oct 6, 2022

Was this helpful?

Provide feedback about this article
Powered by Confluence and Scroll Viewport.