Could not open connection to the host, on port 1433: Connect failed
Asked Answered
J

2

7

When I try to connect from an application to a SQL Server environment on the same machine, the connection fails. I tried to telnet to following

telnet 127.0.0.1 1433

but I got following message:

Could not open connection to the host, on port 1433: Connect failed

enter image description here

Note: When I tried to ping, it was successful.

I need to enable port number 1433 on SQL Server. I am using SQL Server 2008 client (management studio) and SQL Server 2008 Express engine.

Jed answered 11/8, 2013 at 16:8 Comment(4)
Can you post your connection string and the exact error that you're getting? For SQL Server Express, the default is to connect using <Machine Name>\SQLEXPRESS instead of just <MachineName>. If you need to enable remote connections or to do some general troubleshooting with this stuff, then perhaps this resource could be of assistance?Darciedarcy
I did but telnet is still not working. I connect using windows authentication and sql server authentication mode from management studio it is working fine. If I succeed to telnet then my application will definitely connect to database server. Can you please explain.Jed
Are your application and SQL Server instance on separate machines or the same machine? If you can connect via Management Studio then that means your SQL Server instance is up and running - it could also be possible that it is listening on a different port (you should just confirm in SQL Server Configuration Manager).Darciedarcy
Here are some instructions on finding the port which SQL Server Express is listening onDarciedarcy
J
18

The YouTube video How To Connect SQL Server with Internet solved my problem, at the 5:32 mark.

Steps to enable port number 1433 on MS SQL Server 2008:

  1. Open the Start Menu
  2. Select "All Programs"
  3. Find the "SQL Server 2008" folder
  4. Select "Configuration" Tools
  5. Select "SQL Server Configuration Manager"
  6. On the left side of a new window, select "SQL Server Network Configuration"
  7. Select "Protocols for SQLEXPRESS"
  8. Select the "TPC/IP" option which is on the left panel
  9. On the "Protocol" tab, if "Enabled" is set to "No" then set it to "Yes"
  10. Then select on the "IP Address" tab
  11. Scroll down to the last option of "IPALL"; set the "TCP Port" as 1433
  12. Select "Apply" and then the "Ok" button.
Jed answered 11/8, 2013 at 18:15 Comment(5)
setting IPALL TCP Port to 1433 actually stops my SQLEXPRESS service and MSSQL cannot connect anymoreDulcia
I do not know why it stopped your SQLEXPRESS but I have done many times when I configure my clients server. It works fine. Hummm! one thing is that you need to restart your PC. And when I have to setup I always look here.Jed
C:\Windows\SysWOW64\SQLServerManager15.mscAloin
FWIW my SQLServerManager14.msc was in C:\Windows\System32.Coptic
So the answer for you was that your instance of SQL Server was not listening on Port 1433.Daleth
M
1

Even if you did all the steps correctly Note that some vendors have a firewall (like Google Cloud), you need to add the port on the system firewall (not on the local).

Michiko answered 21/11, 2019 at 9:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.