Getting "Network error IOException: Connection refused" During Jira DB configuation

Ben S December 1, 2011

· Trying to connect to mssql server 2008 database in Jira

o Created new database

o Created new login/user with db_owner permissions on new database

o Used config.bat for config

§ Entered ‘localhost’ (no quotes) for hostname

§ Database, username & password

§ Port 1433

§ Schema: blank

o When i test connection I get ‘Could not connect to the DB: Network error IOException: Connection refused: connect’

o I’ve checked that the default port on sql server is 1433 and that it’s a static port.

o Firewall: it is on (but i tried testing the connection w/the firewall down and still got this error message)

I’ve checked the schema and collation type are correct, tcp/ip is enabled and mssql jtds driver is present and working. I also confirmed that the authorization is sql server and windows auth.

Any suggestions as to what to try next?

4 answers

1 accepted

6 votes
Answer accepted
Thomas Lenniger May 11, 2014

Its an issue of the dynamic port.

Goto Windows-Start->Programs->Microsoft SQL Server 20xx->Configuration Tools->SQL-ServerConfiguration-Manager

After starting this Configuration Tool go to SQL-Server-Network-config.-> protocols for [instance name]

Open TCP/IP at right site

Choose IP-Adresses above.

Scroll down to IPAll

Insert in the field for TCP-Port your port 1433

Restart SQL-Server service.

u can check if your server is now listening on port 1433 with queries

use master

sp_ReadErrorLog --(sql server 2012)

--or

Xp_readerrorlog --(sql server 2008 and below)

in the result you should read something like

Server is listening on [ 'any' <ipv6> 1433].
Server is listening on [ 'any' <ipv4> 1433].

TSD Group July 12, 2016

Thanks! It has helped us!

Jason W. Butterfield October 19, 2017

This helped me as well. thanks!

4 votes
Dieter
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.
December 1, 2011
Connection refused definitely means there is no database server listening on localhost:1433 Is your mssql server really configured to listen on port 1433 of 127.0.0.1? Maybe it's just listening on the ethernet interface so maybe using the ip address instead of localhost helps please also be aware that specifying localhost as host means that Mssql must run on the same server as your Jira
Ben S December 1, 2011

Thanks. Changing database server to 127.0.0.1 didn't do it, but I'll double-check that the server is configured to listen to post 1433 of 127.0.0.1.

Ben S December 6, 2011

Thanks again Dieter! I just had to enable TCP/IP in my sql server config mgr (and restart as admin--not sure if that was related).

1 vote
Hong nguyen April 28, 2017

I ran into this or something similar when installing both JIRA and Confluence server solutions (on premise) to use SQL Server 2012.  Our DB runs in a cluster which some other users may encounter as well. I found this article which solved my problem for both JIRA and Confluence setup:

https://confluence.atlassian.com/jirakb/when-connecting-to-a-named-instance-jira-throws-connection-refused-283641388.html

Basically when using the setup wizard, type this in the DB name field: <DB_NAME_HERE>;instance=<DB_INSTANCE_NAME_HERE>

I don't know if this is the proper resolution, but this worked for me in my case

Alexander Schirmer May 30, 2017

Same issue.

Your solution solved it.

Thanks!

0 votes
Dalton Williams February 16, 2012

We have done this but still no luck. I assume that Jira fully supports running Microsoft Server 2008R2 64 Bit?

sampath.ayanampudi October 3, 2013

I have the same issue, does any one manages to find an aswer?

Gordon Myers August 27, 2016

I'm also running into this problem with SQL Server 2016. Did any of you ever find a solution?

Suggest an answer

Log in or Sign up to answer