Remote Desktop Services connection refused - remote-desktop

I was able to connect to my rds through chrome,IE,Firefox. Sometimes the connection would be refused. Now it is just refusing all connections, I'll be able to supply any information needed.

Found the issue, I took it off of DHCP for a test and it got a duplicate IP when I re-assigned it . All is good now !

Related

SQL Server 2017 remote connection error - 40 on GCP

I'm getting SQL error 40 when I try to connect to remote SQL using SQL management studio from my local system. It connects without any error when I switch my wifi to another network but it shows SQL error 40 from my office internet connection. I used to connect earlier from the office too. I've checked multiple networks and it throws the same connection error 40 on some other internet connections too. I've tried using the IP address instead of domain name on those networks but no luck. I've also checked the port on firewall, TCP IP, Named pipes everything is up to the mark. Any help would be highly appreciated.
Error on some internet connection:
Connects fine from other internet connection:
This sounds like a routing or Firewall issue on the troublesome network. It may possibly something to do with a dynamic IP address if it worked earlier on that network.
You need to speak to whoever manages the network on which you are getting the error and ask them to investigate.

Can't connect to SQL Server by name

I'm wondering how can I possibly troubleshoot this. One of our client is having trouble connecting to our server, I went in and used HeidiSQL to see if it can simply establish a connection. It seems that it can connect to the IP address but not the address. All of our clients connect fine except this one client.
What could be the issue? Could it be the host files?
Connection is made through connection string
Have you tried to resolve that name to IP? Might be a DNS issue. In the end an easy fix will be to edit the hostfile to resolve the name to your IP, but this requires maintenance on the machine if that IP ever changes.
A better fix will be to figure out why the name isn't resolving to the correct IP address.

sql whitelisting not working when connected to a university intranet

I have been having troubles to establish database connection using the MS SQL Management Studio. It was working fine when I was using a local internet service provider. However, when I began to use the university internet, I am not able to connect to the db, although I sql-whitelist the ip. I have no ideas how to manage this issue. I have to connect to the db to manage it, but I am receiving "A network-related or instance-specific error occurred while establishing a connection to SQL Server..." Do you have any idea? Is this something that my hosting company should figure out?
Thanks!
There is a reasonably good chance you are being blocked by a firewall at the university. They probably block/allow based on IP. Universities should not allow all IP's in the University net to have access by default.
You may have had a firewall exception for the old address. You can check if port is blocked by using the telnet command from any windows client command line.
telnet 127.0.0.1 1433 -- substitute your sql server ip address or name
telnet 127.0.0.1 22334 -- no reason for the this port to be open
This is what a blocked port looks like
C:\>telnet localhost 22334
Connecting To localhost...Could not open connection to the host, on port 22334:
Connect failed
C:\>
If 1433 is open and associate with ms-sql you get a different behavior (although it is pretty odd) -- you may have to close the command prompt or kill the telnet process. In any case, this confirms the port is open or closed. If port is open and you can't connect, you have a connection string problem or something obscure.

Cannot connect to SQL Server, error: 0 - No Connection could be made because the target machine actively refused it

I'm new to SQL related matters so please bare with my lack of knowledge and asking a question which has been asked countless times before.
I have to connect to a SQL database server which is located at a remote location at xxx.xx.xxx.xx:3306, but every time I try to connect I get the same error:
"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 that 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.)"
I get this same error whether I try to connect using SQL Server Management Studio or in a C# program via:
SqlConnection myConnection = new SqlConnection(...)
myConnection.Open();
I've tried it on two different computers, both on the same home network. I've had a look at the SQL server configuration manager on the computer which I installed SQL Server on, enabling TCP/IP and fiddling with the port values settings, but I'm guessing this is just for configuring an SQL server on my computer and irrelevant to connecting to a remote one. I shouldn't even need to install SQL server to do queries on a remote server anyway, right?
I've turned off my Windows firewall and my router firewall, though ShieldsUP still says
Port: 3306
Status: Stealth
Your system has achieved a perfect "TruStealth" rating. Not a single packet — solicited or otherwise — was received from your system as a result of our security probing tests. Your system ignored and refused to reply to repeated Pings (ICMP Echo Requests). From the standpoint of the passing probes of any hacker, this machine does not exist on the Internet. Some questionable personal security systems expose their users by attempting to "counter-probe the prober", thus revealing themselves. But your system wisely remained silent in every way. Very nice.
I read that this is irrelevant as well, since I'm not the one hosting the server, but when I was given the address, I was given the port as well, so I must have to do something with it. I'm just not sure what. My understanding of ports really is quite shaky.
I've been trying this for over a day now, and I can't think of anything more I can do.
EDIT: I fixed the problem. I had to use MySQL, not MSSQL. Doh. Sorry guys.
If you are sure the remote SQL Server is running on port 3306 (otherwise I'm not sure why you talked in the question about that port specifically), try the following connection string:
user id=username; password=password;
data source=123.45.678.90,3306;
initial catalog=dbname;
Network Library=dbmssocn;
I think without the port you'll have trouble if the other end has disabled the SQL Browser service. You should also make sure it isn't a named instance, in which case you may need:
user id=username; password=password;
data source=123.45.678.90\InstaneName,3306;
initial catalog=dbname;
Network Library=dbmssocn;
First of all the database is local or distant ?
The you have to ensure that your connection string is well written.
Here's an example of a valid connection string :
Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;
More about connection strings :
Connection Strings
Now if everything is set up correctly you have to enable remote connections to SQL Server on the host. To do so please refer to this article :
Enable SQL Server Remote Connections
Just go to ypur serveices and check whether your SQL Server (MSSQLSERVER) is running.Most of the time this error happens when SQL Server (MSSQLSERVER) is stopped.
Then select it right click and click start.problem solved !!!

Accessing SQL Server over an SSH tunnel

In my development shop, we deploy code on virtual servers that sit on a remote network.
We access the machines on that network by first opening an SSH connection to a gateway server, and then SSH-tunneling RDP over a local port.
I would very much like to be able to locally access SQL Server instances running on these servers in the same way.
I've set up a local port (3398) to redirect to the SQL Server port on the remote instance (L3398 -> remote.machine.com:1433).
I can then actually test the connection by telnetting to localhost 3398, and I get a connection: the screen clears and I can type characters to some listening process.
But when I try to connect SSMS to localhost:3398, it times out and then claims that there is no SQL Server listening on that port:
Cannot connect to localhost:3398
Additional 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 that the
instance name is correct and that SQL Server is configured to allow remote
connections. (...)
I am sure that the server accepts remote connections, because I have connected to it remotely while logged in via RDP to a different machine within the remote network.
I have Googled around to know that this is possible; does anyone have some idea why this isn't working, or what I might do to diagnose and hopefully fix the problem?
Thanks!
Instead of connecting to localhost:3398
Use 127.0.0.1,3398
For Authentication type Azure Active Directory - Universal with MFA (Mutli-Factor Authentication), in addition to specifying the port correctly (127.0.0.1,3398), I also had to point the host to localhost.
On Windows, I had to edit my hosts file to include the server host:
127.0.0.1 server.example.com
Then, in SSMS, I could connect to server.example.com,3398, which would perform the MFA correctly.
I could have performed this redirection at a higher DNS level as well.
The issue is probably that SSMS is trying to access the SQL Server Browser Service, which is UDP port 1434. Take a look at http://technet.microsoft.com/en-us/library/cc646023.aspx for an overview of the additional ports you may need to forward to get this to work.
I'm pretty sure I figured out the answer to this, actually.
On the remote network (which we don't control), for security purposes, it appears that the database servers are set up to ignore database requests coming from the gateway machine. So I guess there's just no good solution short of convincing them to give us full VPN access. Thanks everyone for your help.

Resources