I'm trying to run a TELNET command from my Mac OSX to an Oracle DB that is based on a Windows 7 (Virtual machine using Parallels on same Mac) but I get this error:
Connection closed by foreign host
I've already checked the Listener for Oracle and it is activated and listening to 127.0.0.1 on port 1251 and to the VM ipAddress 10.211.55.4 on port 1251
I can successfully run a:
ping 10.211.55.4
I have verified that the port is LISTENING using
netstat -a
And i have checked via services (in Windows) to see if the port is RUNNING... and it is.
Any ideas?
Thanks!
PS: This is my first post so if anything is out of place please let me know...
I have checked various threads and none answer
Thanks for the help!
The problem was not the port. It was rather that for some odd reason (replicable... but odd) Oracle DB installed two instances on my Windows VM and the connections got crossed.
The way I solved this was by removing ALL listeners to BOTH DB's and then creating a new Listener to a single instance.
Related
I had setup a WSL2 Ubuntu. Now I am running a local SQL Server instance on the 1401 port using Docker.
Container port:
0.0.0.0:1401->1433/tcp
I would like to connect this instance from SSMS but I am getting following error:
Server name: localhost, 1401
Error:
Cannot connect to localhost,1401.
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 - The wait operation timed out.)
(Microsoft SQL Server, Error: 258)
[Solution]
I am able to connect it via the WSL2 IP. I run "hostname -I" command in WSL2 and use the same IP in SSMS. And, I am able to make a connection
First question -- Is there a VPN running/connected in Windows? If so, ignore the rest of this and suspect that first. Make sure the VPN is not running, stop Docker, issue a wsl --shutdown, restart and try again.
Assuming that's not the problem ...
Normally, WSL2 provides a feature known as "localhost forwarding" which allows services/apps on Windows to communicate with the virtualized WSL2 IP using localhost. It essentially takes any localhost traffic that isn't directed to a port bound under Windows and forwards it to the Hyper-V virtual network for WSL2.
All WSL2 instances (including the Docker instance) share the same WSL2 network interface as they are all running in the same virtual machine/kernel.
So you seem to be doing the right thing in attempting to connect to localhost from SSMS.
But ... sometimes that localhost forwarding breaks. There are two common (related) scenarios that can cause this (and perhaps others):
Hibernation of the Windows host
Having Windows Fast Startup enabled in Power Manager
First check to make sure you can access 1401 from within WSL2:
nc -zv localhost 1401
^^^ assumes netcat is installed, which it is by default in the WSL2 Ubuntu distribution. For other distributions, install it or check connectivity via other methods.
If that doesn't succeed, then I'd suspect some configuration issue in SQL Server.
If that does succeed, then run the same test from the Windows host in PowerShell:
Test-NetConnection -ComputerName "localhost" -Port 1401
If that doesn't succeed, then I'd suspect a localhost forwarding issue.
Side note: I'm assuming you are running Docker Desktop, but if you are just running Docker Engine in a WSL2 instance, that's no problem. Just ignore the Docker Desktop instructions below.
First, check if you have a /etc/wsl.conf in any of your running WSL2 instances that mention disabling localhostForwarding. I'm assuming no, since that is not the default. However, if you happen to, make sure you set these to true.
Stop all WSL2 services, instances, shells, apps, etc. (including Docker Desktop)
From PowerShell:
wsl --shutdown
Then restart Docker Desktop and/or your container and try again
If localhost doesn’t work, try use [::1] in the server name. In WSL2, port 1433 is using IP/TCPv6, SSMS some times is not able to resolve localhost to loopback IP [::1].
Source: https://jayfuconsulting.wordpress.com/2020/11/14/sql-server-2019-docker-wsl-2/
One last thing which you could try is to modify the windows host file. I almost tried all the steps mentioned over different link, but all goes in vain. Then I opened the host file which could be accessed using
C:\Windows\System32\Drivers\Etc
Open the host file and uncomment(remove # sign) from the localhost name resolution section
I am pretty new to postgreSQL. I am running version 9.5 of it on my main machine. I am trying to establish a telnet connection from my virtual machine. Before doing that I have configured the postgresql.conf and pg_hba.conf files to accept connection from remote machine in the same network.
However when I start the postgresql service using:
service postgresql start
The process show the status:
active(exited)
and the telnet connection is also refused(when i run telnet x.x.x.x 5432). Also when i start the postgresql service using
systemctl start postgresql#9.5-main
the status is active(running) but the telnet connection is still refused. Can anyone tell me how to establish the telnet connection? I dont really know whats going on and I am new here so please dont mind if its a noob question
I get the following error when attempting to connect to the Postgres instance on my server.
Access to database denied
The server doesn't grant access to the database: the server reports
FATAL: no pg_hba.conf entry for host "fe80::2d93:af94:879c:4fa%12", user "postgres", database "postgres", SSL off
I have tried the three obvious solutions found HERE. Namely I attempted Syed Aslam solution found in that^ link.
I tested that I was restarting the service correctly by removing some config to break my local pgAdmin III connection. I have checked if my firewall was blocking the connection by temporarily turning it off.
Can anyone help me figure out why I am getting this error?
Postgres 9.4.1
pgadmin III version 1.20
Windows Server 2012 (host)
Windows 7 (trying to connect from this to the host)
It turns out that I had an IPv4 as the IP address in my entry for the pg_hba.conf. After changing it to an IPv6 version like this:
IPv4 = 0.0.0.0/0
IPv6 = ::/0
It all worked as I would have expected. The comment from user_0 and the documentation found HERE cleared it up for me.
Obviously the answer works in reverse if you're using an IPv6 when you should be using an IPv4.
I have a Sql Server instance installed on my Azure Virtual Machine. I've changed the port for Sql Server to...let's say 4849. I opened this port in Windows Firewall and established the endpoint for both TCP and UDP. I check to see if the port is open via http://www.yougetsignal.com/tools/open-ports/ and it's still closed. What am I missing here?
I'm utilizing SQL Server 2012 SP1 on Windows Server 2012.
Thanks in advance!
Not sure how this service checks for opened ports, but if it doing so by sending "ping" command then it may not work. You would need to do additional stuff for that to work. Please check this blog post for more details: http://blogs.biztalk360.com/windows-azure-virtual-machines-virtual-network-may-not-ping-automatically/.
Does this need to be accessible to the outside world? If so, you will need to open it on your firewall and have the firewall forward traffic on that port to your VM.
Also, you might need to check the config of your VM network adapter, if it's using NAT to share the hosts IP address, you might encounter problems, depending on what host you're using, I find that bridged mode works best so that the VM can use it's own IP address on the network.
I think you can also try this one to enable PING command for Azure virtual machine: http://blogs.biztalk360.com/windows-azure-virtual-machines-virtual-network-may-not-ping-automatically/
I am running MAC with parallels installed. I have windows 7 Pro installed on Parallels, and SQLServer Express 2012 installed on Windows 7.
I am trying to connect to the SQL Server database from the Mac OS, but not having any luck.
I followed this post here, but still unable to connect. So I am thinking it may have to do with it running in a VM?
I'm receiving the following error when attempting to connect:
ERROR: An error occurred while trying to make a connection to
the database:
JDBC URL: jdbc:jtds:sqlserver://10.211.55.4:1433;appName=RazorSQL;ssl=request;useCursors=true
Login
timed
out.
I am able to ping the IP address.
Has anyone set this up? Any tricks or pointers you can suggest?
Many thanks in advance
It turned out to be the firewall on Windows 7. Once I created a rule to allow traffic through on Port 1433, I was able to connect fine.
This was done by
opening "Windows Firewall with Advance Security".
Selecting "Inbound Rules" > "New Rule".
Selecting "Port" as the rule type, then entering 1433 as the port number to allow.
You have to change the default behavior of Parallels to use NAT, and use a dedicated IP (in the 10.x.x.x range to avoid IP collision with your own network!), then connect to this IP.