Connecting to SQL Server 2017 with remote computer isn't working - sql-server

I'm not able to connect to my SQL Server 2017 that is installed on my desktop from any remote computers.
Here are the steps and actions I have taken:
I followed all troubleshooting steps on https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/troubleshoot-connecting-to-the-sql-server-database-engine#testing-a-local-connection
Turned off windows firewall on both computers (to eliminate this)
Tested tcp by connecting on the same computer as the server with tcp:localhost and I was able to connect
Used a port check tool to make sure the port was open
SQL Server remote connections allowed: http://prntscr.com/gvb1gb
SQL Server tcp/udp turned on: http://prntscr.com/gvb2yh
Router settings showing port forwarding is configured: http://prntscr.com/gvb3jm
I ran out of ideas and I don't know what else to do to connect to this sql server from a remote computer. Does anyone have any ideas on what I can try next?
UPDATE: I added port forwarding for 1434 udp in addition to the 1433: http://prntscr.com/gvbd01

Related

Connecting to SQL Server from a different network

I recently set up SQL Server locally and have followed the numerous guidelines on this website and others to connect to it from a different network:
Connect to MS SQL Server 2014 from a computer on a different network
Connect to MS SQL Server 2014 from a computer on a different network
Firewall rules to allow remote connection to SQL Server in a different domain
How to use SQL server from a different network
This is what I have tried so far:
Ports 1433 and 1434 have been enabled in SQL Server Config Manager
Based on these suggestions in the links above, I have added inbound rules to my firewall to create exceptions for SQL Server and its associated ports (Ports: 1433 & 1434).
When I try using telnet to connect, I get the following:
Connection closed by remote host
When I try checking the status of my port from the following website:
http://ping.eu/port-chk/
It indicates that my port is closed (both 1433 & 1434).
When I try connecting from a different machine on the same network, I am able to do so without issue.
I do not understand what other layer of protection exists that is blocking connections to my local version of SQL Server.
Any guidance is greatly appreciated.
Thanks.

Firewall Port 1433 not opening

I am using MS Server 2008 with MSSQL 2008-R2 as database server.
Each time for some work i have to login to server via Remote connection.I tried to configure
the SQL Server remote connection on, followed the following steps....
1.Created Inbound and outbound rules for tcp port 1433.
2.In sqlserver configuration manager ,all is set for IP address and POrt no properties.
3.Set the SqlServer instance for remote connections.
But still its not working.
Also when i checked port 1433 for tcp on local computer it is shown closed.
thanks in advance.......
Probably port 1433 is disabled, so enable it using MS WIndows firewall.
or just use
netsh firewall set portopening protocol = TCP port = 1433 name = SQLPort mode = ENABLE scope = SUBNET profile = CURRENT
Probably MS SQL Server Browser Service is not running. So go to Services and start it.
or just execute under Run menu
%windir%\system32\services.msc
Probably TCP/IP channel is disabled under SQL Server 2008/2014 Configuration Manager. SO go there and enable all TCP/IP options.
Just in case at the same place (SQL Server 2008/2014 Configuration Manager) make sure you have 1433 port.
Make sure that SQL server is configured to allow remote connections. Use MS SQL Management Studio and right click on the top node which server itself.
In the SQL Server Configuration Manager->SQL Server Network Configuration->Protocols, check that named pipes and tcp/ip are enabled.
If that doesn't work then it may be your firewall blocking it, try this link: http://msdn.microsoft.com/en-us/library/cc646023.aspx
This may be useful too:
http://support.microsoft.com/kb/287932
If named pipes and TCP/IP access are already enabled in SQL Server Configuration Manager, then you need to either add a rule for UDP port 1434, or a rule for sqlbrowser.exe so that the SSMS client can talk to the SQL Server Browser service.
I actually see people having this problem surprisingly often so I wrote up an explanation here: http://blog.dereenigne.com/microsoft-sql-server-dynamic-ports-windows-firewall-and-you/
If you're trying to connect to an SQL Server Express instance as is my case right now... it doesn't use port 1433 by default. One must check the IpAll => TCP Dynamic Ports in Sql Server Configuration Manager. Mine is 52848.
After entering the correct port 52848 in DbSchema app (the one I'm trying to use), it connected successfully.
Check the following screenshot:
This is the way to go:
The default SQL Server express installation does not enable TCP
network protocols, so here are some steps to take to be able to
communicate with SQL Server Express. These steps should be similar for
MS SQL Server Express 2017, 2016, 2014, 2012, 2008, and 2005.
Launch the SQL Server Configuration Manager. It should be in the Start -> Programs -> Microsoft SQL Server 2005 -> Configuration Tools start menu option.
Select the SQL Server 2005 Network Configuration tab. There should be a Protocols for SQLExpress option, and one of the protocols should be TCP IP.
Enable the TCP IP protocol if it is not enabled.
The default port for SQL Express may not be 1433. To find the port it is listening on, right-click on the TCP IP protocol and scroll all the way down to the IP All heading. There should be a section called TCP Dynamic Ports. This should list the port SQL Express is listening on. You can then put this value into the port field when adding the connection profile via RazorSQL.
Make sure to restart SQL Express before trying to connect.
Text kindly reproduced from:
https://razorsql.com/docs/support_sqlserver_express.html
I had multiple NICs in my server. When I went to SQL Server Network Configuration -> TCP/IP and right clicked for properties there was a list of the NICs and at the bottom was the open port for my SQLEXPRESS. It was not 1433..... I do not know if there is a default but mine was in the 49,000 s.

Remote connect to SQL Server Standard Edition from PHP/FreeBSD

Unable to connect to our company MSSQL server from one of our FreeBSD servers.
# telnet 192.168.1.51 1433
Trying 192.168.1.51...
telnet: connect to address 192.168.1.51: Connection refused
telnet: Unable to connect to remote host
No firewall running on the MSSQL server, and i have opened the default port on the BSD-FW
00210 allow tcp from any to any dst-port 1433 in
00215 allow tcp from any to any dst-port 1433 out
Any ideas on this?
The specifics of the MSSQL server running on a Windows Server 2003
Test whether you can connect from another non-local machine. If not TCP connections may not be enabled for SQL Server. Here are instructions for enabling TCP/IP Connections with SQL Server 2000
I updated it MSSQL to Service Pack 4, and i'm now able to telnet to the server on the specified port. And also connect to the server from PHP with pdo_dblib

Connecting to SQL Server 2000 through TCP/IP on localhost failed

I have tried to connect to SQL Server 2000 through TCP/IP.
I followed these steps and enabled SQL Server 2000 on port 1433.
Then I used the command to test whether the port is opened up:
telnet localhost 1433
But I found the following error:
Connecting To localhost...Could not open connection to the host, on port 1433:
Connect failed
And I also failed to connect to the server by following these steps.
How to solve this problem and connect to Sql Server 2000 through TCP/IP?
See my configs
By default TCP-IP is disabled.
You need run SQL Server Configuration Manager->SQL Server Network Configuration and enable the protocol, then restart SQL Server service
Try disable your firewall temporarily and see if it makes a difference, to isolate the problem.
EDIT: Wait, did you enable TCP/IP on the client or server ? If you only enabled it on the client, then that explains it.
It must be enabled on both to allow communication. From your error, it looks like the server does not accept TCP connections. I don't remember what SQL 2000 calls the program, but find something like "SQL Server Network Configuration", not "Client Configuration". And turn on TCP there.
Perhaps show us a screenshot of your network configuration dialog.
I did following actions to remove this bug
1)Disable Other Protocols other than TCP/IP from SQL Server Client And Server Utilities
2)Re-Instal SQL Server 2000 sp4
I think you need to be running SQL Server Agent to connect via TCP/IP on 2000.
This behavior is by design:
http://support.microsoft.com/kb/929152
Use an alternative representation of the name of the local host address instead of "localhost". Possible alternative representations include the following:
127.0.0.1
"."
The actual local host name
Installed SQL Server 2000 SP4 and it solved the problem for me.

SQL Server 2008 remote connection only works once

When I connect to the SQL Server 2008 remotely it only works once, after that the server hangs. The service cannot be stopped or restarted and when trying to connect again it gives a 'Timeout' error.
The server has TCP/IP connections enabled. The default port is set to 1433 and I cleared the 0 from the dynamic ports. I enabled the 127.0.0.1 IP and the public IP and set the 1433 IP to them. Named pipes and the other protocol (Shared Memory or something) are disabled.
I am connecting from the remote machine using the 'sa' user and a strong password. The server is set to accept both authentication modes.
Connecting for the first time from the remote machine works perfect. Queries work and data can be retrieved from the databases. After disconnecting and trying to connect again it gives a timeout error. This error is generated because the SQL Server is hanged somewhere.
At this point it is impossible to Stop or Restart the SQL Server service from the service machine. The only solution is to restart the computer. However, connecting to the server locally from SQL Management Studio still works.
I think it has something to do with going into an infinite loop somewhere, or it doesn't drop the connection on the 1433 port after disconnecting from the remote machine and it still waits for input from it.
have you ruled out anything at the network layer such as software or hardware firewalls, NAT'ing, proxies ect?
Are you running SQL Server as a default or named instance?
if you do a netstat while things are working & then when you get a time out, what do you see?
Try running network monitor or wireshark on the server to see if the request is getting through & if so is the server responding?
EDIT:
It's a bit of a concern that you can connect to the server on port 1433 when sql server isn't running you should be getting a connection refused (no firewall) or a timeout (with a firewall)
Run profiler on the server & audit logins/logouts you should be able to see the client connect? it may help you troubleshoot the issue?
Try a blunt instrument like re-installing the sql server connectivity driver eg. mdac, sql native on the client.

Resources