I keep on getting this error. I tried one solution from Stack Overflow (below), which did not work for me: SQL Exception while connecting to SQL server
I tried allowing port 1433 in the Windows firewall by using a link, that did not work either. Refer to section "To open a port in the Windows firewall for TCP access" http://msdn.microsoft.com/en-us/library/ms175043.aspx
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host localhost, port 1433 has failed. Error: "Connection refused: connect. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.
Please help me to fix this problem.
Double click on TPC/IP which is on left panel. On Protocol tab if Enabled is No Then Make Yes. Then click on IP Address tab. Scroll down and last IPALL, set TCP Port as 1433.
Enable TCP/IP in the SQL ServerExpand the Configuration Tools subfolder and right-click on SQL Server Configuration Manager. Click on Run as Administrator. Select SQL Server Network Configuration and click Protocols for SMTKINGDOM. In the right pane, right-click TCP/IP and click Enable.
On the local machine, click the Start button and enter “CMD” in the search programs and files field. If the port 1433 is closed, an error will be returned immediately. If the port 1433 is open, you will be able to connect to the MS-SQL server.
You need to go to Start > Microsoft SQL Server > Configuration Tools > SQL Server Configuration Manager
When it opens, go to SQL Server Configuration Manager > SQL Server Network Configuration > Protocols for SQLExpress
.
There you'll find the Protocol TCP/IP, if disabled then Enable it. Click on TCP/IP, you'll find its properties.
In these properties, remove all the TCP Dynamic Ports and add value of 1433 to all TCP ports, and restart your SQL Server Services > SQL Server
And it's done.
Steps
Open the Sql Server Configuration Manager (Start -> Programs -> Microsoft SQL Server 2008 -> Configuration Tools)
Expand SQL Server Network Configuration -> [Your Server Instance]
Double click TCP/IP
Under Protocol:
Ensure Enabled is Yes
Under IP Addresses:
Scroll to the bottom and set the TCP Port under IPAll, (1433 by default)
Find the IP address you want to connect to and set Enabled and Active to Yes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With