0

I am unable to connect(using my ASP.NET web forms application or SSMS) to my database server that has a public IP. I am successfully connecting to that server using Remote Desktop Protocol but SSMS on my machine is unable to connect to that Server. I tried following things:

  1. Added an inbound firewall rule for port 1433.
  2. In SQL Server Configuration Manager I added my public IP address:

enter image description here

I don't know what to try next. Please tell me what else can cause this?

Also, sometimes SSMS shows that Network path not found or sometimes it shows Server didn't reponded in time.

Aishwarya Shiva
  • 3,460
  • 15
  • 58
  • 107
  • 2
    You could verifiy ithat you can connect to that server on the specified port using telnet. – Luc Sep 19 '15 at 14:23
  • @Luc Telnet is giving me this error: `A connection attempt failed because the connected party did not properly respond after a period of time.`. But my application is opening with that IP in my browser. I tried connecting to `:1433` – Aishwarya Shiva Sep 19 '15 at 15:02
  • 1
    If telnet can't open the connection, it the problem is network related, in/out bound firewall rull of so. You can use wireshark to see if that gives you more information. It can be useful, but it is quite overwelming – Luc Sep 19 '15 at 15:43

2 Answers2

1

I've had the same problem since my work computer is attached to a large network where computers cannot see one another. The strangest part about this is I can see other computers in my building in windows explorer.

Anyway, the stuff I've done is try UTP, which is port 1434; set up SQL login credentials; Restarting the service after changing the port settings (It's important); The very bottom of the page you have screenshotted contains a generic TCP dynamic port and TCP Port setting, I've changed those. In SSMS right click on a database and say "allow remote connections." here you can also set the timeout and such

What's really weird to me is that another computer can see the database, but cannot connect.

If you've tried all that I've tried as above then you're at the same place I am. I am also using SQL-2012, but on windows 7 enterprise. I'd test some more things but I'm not at work. Also I would have just commented but I can't ):

  • also, check this out. It looks like others have had success! Their is hope!! [Stack, enable remote SQL](http://stackoverflow.com/questions/11278114/enable-remote-connections-for-sql-server-express-2012?rq=1) – Nathan Dobie Sep 19 '15 at 14:28
  • I tried all the settings you suggested and on that link. But nothing worked. – Aishwarya Shiva Sep 19 '15 at 15:36
  • Just thought I'd give all of the things I've heard about. I have the same problem as you it appears. I'm going to try connecting remotely through visual studio and also try sharing the log and database file so that another computer can access the data and write to the log, even though it doesn't really fix the problem. I'm also curious if it's something to do with microsoft licensing of SQL, that all people that touch the database must have a unique licence. – Nathan Dobie Sep 19 '15 at 16:46
  • I solved it. Check my answer. If you can identify the reason then please tell me. – Aishwarya Shiva Sep 21 '15 at 16:34
  • I found out that the domain I was located on blocked the port traffic, but only under certain conditions. It was odd because port query would work. But rather than fight with IT my department went with amazon redshift (it's not as fast as it says it is btw, even apc with an external hard drive that's well indexed with SQL is faster). just my $0.02. – Nathan Dobie Feb 14 '16 at 19:36
0

Finally, I solved it myself. I don't know why but Firewall rule was not being applied. But then I found that my Google cloud console also provides an option to add Firewall rule. So, instead of adding the rule directly to Windows Firewall, I added it in Google Cloud Firewall settings. And it worked like a charm. Don't know why this solved my problem. It will be great if anyone can explain the reason.

Aishwarya Shiva
  • 3,460
  • 15
  • 58
  • 107