SQL SERVER – Could not connect to TCP error code 10061: No connection could be made because the target machine actively refused it

I was recently getting following error in my StreamInsight Application.

Could not connect to  TCP error code 10061: No connection could be made because the target machine actively refused it.

The solution was very simple, I had to enable exception of the my port in my windows firewall. The way I figured it out  was by quickly disabling the firewall (it was not a production server). Once I disabled it, the application just worked fine; this was a sign that the firewall was the cause of the issue, I right away enabled firewall and added my port as exception.

So many errors have cropped up recently due to the connectivity issue. I have started to make my routine to check firewall first before I move to next action item in my troubleshooting list.

When I sent this detail to my internal technical list of the expert, I got the suggestion that this error happens due to many other reasons as well and not only due to firewall.

I am interested to know when and how this error happens and what is the resolution. This way, if we have complete list, we can avoid this error in future.

Watch SQL in Sixty Seconds video to Resolve Connection Error:

Reference: Pinal Dave (http://blog.SQLAuthority.com)

16 thoughts on “SQL SERVER – Could not connect to TCP error code 10061: No connection could be made because the target machine actively refused it

  1. Hello!

    This execption/error stumps most developers/IT staff who have just recently been exposed to Windows Server 2008 R2. I belive the R2 blocks incoming transactions by default, while the vanilla-2008 did not. Therefore, all of a sudden a system/database that worked fine on a Windows 2008 Server fails to accept connections from remote machines when upgraded to run on Windows 2008 R2 Server.

    Like

  2. I am facing the same database connetivity issue but i am connecting to local database where firewall not comes in the picture.

    please suggest.

    Like

  3. exec sp_SendSmtpMail ‘vasudevveeramalla.veeramalla@emirates.com’,’vasudevveeramalla.veeramalla@emirates.com’,”,”,’Test Subject’,’Test Message’,1

    When am executing the above procedure am getting like this error

    Description: The message could not be sent to the SMTP server. The transport error code was 0x800ccc15. The server response was not available

    Can you please any one help to resolve the issue

    Like

  4. I’ve disabled the firewall on my Windows Embedded 2009 POSReady and I’m still not able to connect to the DB. What are some other avenues to pursue. It’s all local to one machine, not networked.

    Like

  5. Pingback: SQL SERVER – Resolving SQL Server Connection Errors – SQL in Sixty Seconds #030 – Video « SQL Server Journey with SQL Authority

  6. I had the same error which was coming and dont need to worry about this error, just restart the server and restart the SQL services. This issue comes when there is low disk space issue and system will go into hung state and then the sql services will stop automatically.

    Like

  7. Though the firewall was disabled for the specific port I had the same problem.
    SQL Server Browser was turned off, switching on the browser solved the issue.
    Before I’ve not known anything about this browser…

    Like

  8. Hi Pinal,
    I have slightly more inexplicable issue.
    I have SQL 2012 Standard installed on one server called SQL01, running Server 2008 R2 Datacentre 64-bit
    There are 3 instances on there, one default and two named instances.
    I have another server called APP13 running Server 2012 R2 Datacentre 64-bit with SQL 2012 Management Studio installed on it.
    Both servers are on the same LAN and domain, and I am logging onto both servers with the domain admin credentials. All SQL instances are using Mixed Mode Auth, and the domain admin is sysadmin on all instances.

    From SQL01 using management studio, I can connect to all 3 instances fine using SQL01\instancename convention.
    From APP13 using management studio, I can only connect to the default instance using SQL01
    I can connect to the named instances also, but only using the IP address of SQL01, not with servername.

    Windows firewall on both servers has been disabled, remote connections allowed on all instances, and named pipes and TCP/IP enabled through SQL Server Config Manager.
    The SQL Browser service has been re-started, but SQL01 cannot be seen from Management Studio on APP13, but as mentioned before, I can connect to the default instance by manually typing in SQL01
    I have tried adding an entry into the hosts file, for SQL01, but this made no difference.

    The error is:
    Cannot connect to SQL01\ABC.
    Addtional information:
    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 – No connection could be made because the target machine actively refused it.) (Microsoft SQL Server, Error: 10061)

    Any help or suggestions appreciated.
    Kind Regards,
    Minal

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s