On this page:
2. Create and Configure the SQL Server Database
- Create a database for JIRA to store issues in (e.g.
jiradb). Remember this database name, as it will be used to configure JIRA's connection to this database in subsequent steps.
- Collation type must be case-insensitive, for example, 'SQL_Latin1_General_CP437_CI_AI' is case-insensitive collation type. 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.
- Create a database user which JIRA will connect as (e.g.
jiradbuser). Remember this database user name, as it will be used to configure JIRA's connection to this database in subsequent steps.
This database user should not be the database owner, but should be in the
db_owner role. (See SQL Server Startup Errors for details.)
- Create an empty 'schema' in the database (e.g.
jiraschema) for the JIRA tables. Remember this database schema name, as it will be used to configure JIRA's connection to this database in subsequent steps.
A 'schema' in SQL Server 2008 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 2008 schemas in the relevant Microsoft documentation.
- Ensure that the database user has permission to connect to the database, and create and populate tables in the newly-created schema.
- Ensure that TCP/IP is enabled on SQL Server and listening on the correct port (which is 1433 for a default SQL Server installation). Remember this port number, as it will be used to configure JIRA's connection to this database in subsequent steps.
Read the Microsoft documentation for information on how to enable a network protocol (TCP/IP) and how to configure SQL server to listen on a specific port.
- Ensure that SQL Server is operating in the appropriate authentication mode. 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'
- Turn off the SET NOCOUNT option. (The JIRA on MS SQL Server document provides details on the errors that occur if SET NOCOUNT is set.) To turn off SET NOCOUNT:
- Open SQL Server Management Studio and navigate to Tools -> Options -> Query Execution -> SQL Server -> Advanced. The following screenshot displays the configuration panel for this setting in MSSQL Server 2008. Ensure that the SET NOCOUNT option is not selected:
3. Copy the SQL Server JDBC Driver to Your Application Server (JIRA WAR Only)
Skip this step if you are using JIRA Standalone distribution. JIRA Standalone includes the SQL Server JDBC driver.
- Download the SQL Server JDBC driver (v1.2.4) from JTDS.
Microsoft have their own JDBC driver but we have not tested JIRA with it. Previous versions of the MS JDBC driver have been known to cause issues: (JRA-5760 and JRA-6872), workflow problems (JRA-8443) and Chinese character problems (JRA-5054).
- Add the SQL Server JDBC driver jar (
jtds-1.2.4.jar) to the
4. Configure Your JIRA Server to Connect to Your SQL Server 2008 Database
There are two ways to configure your JIRA server to connect to your SQL Server 2008 database:
4.1 Connecting JIRA to SQL Server 2008 Using the JIRA Configuration Tool
The JIRA Configuration Tool is only available with JIRA Standalone.
To connect JIRA to SQL Server 2008 using the JIRA Configuration Tool:
- Click the 'Database' tab.
- From the 'Database type' drop-down choose 'SQL Server'.
The JIRA Configuration Tool will display your current database configuration settings if any are already set.
- Fill in the connection details for your SQL Server 2008 database.
- 'Hostname' — The name or IP address of the machine that the SQL Server 2008 server is installed on.
- 'Port' — The TCP/IP port that the SQL Server 2008 server is listening on. You can leave this blank to use the default port.
- 'Database' — The name of your SQL Server 2008 database (into which JIRA will save its data).
- 'Username' — The user that JIRA uses to connect to the SQL Server 2008 server.
- 'Password' — The user's password to authenticate with the SQL Server 2008 server.
- 'Schema' — The name of the schema that your SQL Server 2008 database uses.
You might need to change this from the default 'dbo'.
- JIRA keeps a pool of database connections open to the database server. You can set the maximum size of this pool in the 'Pool Size' text field.
- After typing in your settings, click the 'Test Connection' button to test the connection settings. The tool will attempt to connect to the database, and give a message with the results.
- Click 'Save' to save your settings when you are done.
- The JIRA Configuration Tool will save your database configuration to a
dbconfig.xml file in your JIRA Home Directory.
- JIRA must be restarted for your new settings to take effect.
Congratulations — you have finished! Proceed to 'Next Steps' below.
4.2 Connecting JIRA to SQL Server 2008 Manually
dbconfig.xml file at the root of your JIRA Home Directory.
If this file does not exist, create the file, copy and paste the example XML code below into this file and edit the pasted XML as required.
Ensure that the
<database-type/> element's content specifies your type of database, as shown below.
Also ensure that the
<schema-name/> element's content matches the name of the SQL Server's schema specified when creating your JIRA database (above).
If you have a named SQL Server instance, your
<url/> element's content may look similar to —
When editing your
dbconfig.xml file, escape any '
&' characters by adding '
amp;' to the end of each one.
<?xml version="1.0" encoding="UTF-8"?>
<password>[enter db password]</password>
- Save your edited
dbconfig.xml file (at the root of your JIRA Home Directory).
JIRA must be restarted for your new settings to take effect.
5. Next steps
You should now have JIRA configured to connect to your SQL Server database. The next step is to start it up!
- If you are using JIRA Standalone, start it up and watch the logs for any errors.
- If you are using JIRA WAR, rebuild and redeploy the webapp in your application server.
Please see JIRA and MS SQL Server 2008.