When connecting to a named instance JIRA throws Connection refused
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Problem
When attempting to connect to a database during a JIRA installation you get the following error:
1
2
3
Error connecting to database
Network error IOException: Connection refused: connect
Connection refused: connect
Cause
Connecting to a named SQL database instance (popular with Clustering implementations of SQL Server) requires a special syntax.
Resolutions
ℹ️ Confirm that there is no firewall blocking the connection and the SQL server is running and accepting connections from JDBC-based utilities.
Manual Database configuration
Stop JIRA.
Use the following $JIRA_HOME/
dbconfig.xml
, replacing the username, password, and URL information as appropriate.JIRA 7.4.x versions and before using the jtds database driver:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
<jira-database-config> <name>defaultDS</name> <delegator-name>default</delegator-name> <database-type>mssql</database-type> <schema-name>jiraschema</schema-name> <jdbc-datasource> <url>jdbc:jtds:sqlserver://<YOUR_SERVER_FQDN>/<YOUR_DB_NAME>;instance=<YOUR_INSTANCE_NAME></url> <driver-class>net.sourceforge.jtds.jdbc.Driver</driver-class> <username>jiradbuser</username> <password>password</password> <pool-min-size>20</pool-min-size> <pool-max-size>20</pool-max-size> <pool-max-wait>30000</pool-max-wait> <pool-max-idle>20</pool-max-idle> <pool-remove-abandoned>true</pool-remove-abandoned> <pool-remove-abandoned-timeout>300</pool-remove-abandoned-timeout> <validation-query>select 1</validation-query> <min-evictable-idle-time-millis>60000</min-evictable-idle-time-millis> <time-between-eviction-runs-millis>300000</time-between-eviction-runs-millis> <pool-test-while-idle>true</pool-test-while-idle> </jdbc-datasource> </jira-database-config>
JIRA 7.5.x versions and above using the Microsoft SQL database driver:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
<jira-database-config> <name>defaultDS</name> <delegator-name>default</delegator-name> <database-type>mssql</database-type> <schema-name>jiraschema</schema-name> <jdbc-datasource> <url>jdbc:sqlserver://<YOUR_SERVER_FQDN>\<YOUR_INSTANCE_NAME>:1433;databaseName=jiradb</url> <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class> <username>jiradbuser</username> <password>password</password> <pool-min-size>20</pool-min-size> <pool-max-size>20</pool-max-size> <pool-max-wait>30000</pool-max-wait> <pool-max-idle>20</pool-max-idle> <pool-remove-abandoned>true</pool-remove-abandoned> <pool-remove-abandoned-timeout>300</pool-remove-abandoned-timeout> <validation-query>select 1</validation-query> <min-evictable-idle-time-millis>60000</min-evictable-idle-time-millis> <time-between-eviction-runs-millis>300000</time-between-eviction-runs-millis> <pool-test-while-idle>true</pool-test-while-idle> </jdbc-datasource> </jira-database-config>
This difference in the jdbc database drivers was noted int he JIRA 7.5 release notes as well, and in the KB Updating JDBC URL for Microsoft SQL Server.
Start JIRA and verify it starts up.
Setup Wizard Method
Step 2 of 4 in the setup wizard will prompt you for the database name. Use the following syntax for the database name.
JIRA 7.4.x and before versions:
1
<DB_Name>;instance=<Instance_Name>
JIRA 7.5.x and higher versions:
1
<Instance_Name>;databaseName=jiradb
Was this helpful?