When I run the command:
"connection = cx_Oracle.connect(user, pw, dsn, encoding='utf8')",
then I got the error:
"ORA-12170: TNS: Connect timeout occurred."
For additional information; on my tablet, first I connected to a non static ip address; then connected to my desktop remotely that has a static Ip address. I am working on my remote desktop with all the programs included (oracle, python, etc.)
Related
I have SQL Server Express 2017 running on Windows Server 2016 Standard (default instance, not named). It has remote connections enabled and is listening on port 1433 and has TCP/IP and Named Pipes enabled. I have several Surface Tablets running Windows 10 and Windows 11. These tablets make a VPN connection to the server to connect to SQL Server. All of the tablets, except one of them, can connect to SQL Server. All tablets connect using the server's IP address and with SQL Server Authentication. All tablets are connected to the same WiFi router - both the ones that CAN connect and the one that CANNOT, so I believe router settings are not the problem.
The tablet that fails to connect can ping the server successfully. It cannot, however, telnet to port 1433 on the server - this times out. All other tablets can make the telnet connection. Also, using sqlcmd to connect (sqlcmd -S ip-address -U user-name -P password) works on all tablets except the one. This returns error 53. Checking the SQL Server logs after attempting to connect using sqlcmd shows no errors. So this tablet is definitely not even reaching SQL Server.
I have disabled all Windows Firewall options on the tablet with no change - still cannot telnet or connect via sqlcmd.
I have walked through multiple remote connection troubleshooting guides step by step, but most of them assume that NO remote systems can connect to SQL Server. In this case, it is just one system. So I know that the server is configured properly to allow remote connections. I just cannot determine what is different about this one tablet that is preventing it from making a connection.
What might be preventing this one system from making this connection? Any settings or other options I should be looking at?
SOLVED: After performing tracert on multiple systems that connect to this server including the problem tablet as well as attempting to telnet to various ports at the server's IP address, I discovered that the WiFi network that the tablet was on had a conflicting IP address with the server. The previous tablets that tested fine were, unbeknownst to me, on different wifi networks that did not have this conflict. As a result, this tablet was attempting to connect to a completely different device despite being properly connected to the server's network via VPN.
So the additional piece of advice to add to this troubleshooting process would be to very closely scrutinize the output of ipconfig /all. Even though you may be connected to the network of the SQL Server system you are trying to connect to remotely, if the IP of the SQL Server system is duplicated on your local network, it can be very difficult to see that all of your connection attempts are actually routing to a different system - that is why the connection is failing.
What to look for in ipconfig /all... check the client system's IP address and the default gateway that it is using. If these are using private IP addresses (as most do) most commonly starting with 192.168.x.x, and you are trying to connect to SQL Server over VPN via which the server also has a private IP address, check if your local subnet is matching the server's subnet. For instance, both the client (tablet) subnet and the server subnet were 192.168.20.x There's a chance for an IP address conflict in these conditions.
Another check that I found was helpful was, on the client, to DISCONNECT from the remote server and then try to ping the SQL Server IP address. If the ping succeeds, the server's IP address is being duplicated by another system.
I am trying to port a web api that acts as a front-end for an SQL Server database. The web api works fine under Windows and when deployed to IIS, works from .Net Core on Windows, but gives a connection error when ran from within OSX or Linux.
The connection string that worked from within Visual Studio in Windows was
connectionString="data source=A\B;initial catalog=C;
persist security info=True;user id=X; password=Y;
MultipleActiveResultSets=True;App=EntityFramework"
providerName="System.Data.SqlClient"
which is then translated into the connection string for the .Net core variant as:
Server=A\B;Database=C;user id=X;password=Y;
The project compiles fine, even works under .Net core in Windows, but crashes when run from a *nix machine.
The error is:
Unhandled Exception: System.Data.SqlClient.SqlException:
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: 35 - An internal exception was caught) --->
System.AggregateException: One or more errors occurred. (No such device
or address) --->
System.Net.Internals.SocketExceptionFactory+ExtendedSocketException: No
such device or address
I can ping the address, but I guess the combination of valid address (A) and server instance (B) does not work with a simple slash under *nix.
Server=A\B;Database=C;user id=X;password=Y;
says that you are accessing to B instance on a Windows machine whose Netbios name is A. Probably the windows machine where it worked was "A" itself.
For a remote connection though there are things that you should have done:
The SQL server instance should be set to allow remote connections.
The port on SQL server listens to must be enabled for access on firewall.
Instead of Netbios name, it is better to use IP address, along with port number if it is not the default port (1433).
You may start trying (where 1.2.3.4 is the windows machine's IP):
1.2.3.4\B;Database=C;uid=X;pwd=Y
For a detailed installation and setup of SQL Express on host PC, enabling for remote access and then accessing from remote computer, you may watch my short video series. Those videos were about installation of my application but most of it contains installing MS SQL server and accessing from remote location. It is a 4 parts series and here is the link to first part:
AccuSQL Installation 1/4
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.
I installed Oracle 11g Standard Edition on my machine ( Windows 7 X64 ) and configured a listener. While being on the network , when I tried to connect through Jdev 11g , connection was successful. But when I'm off the network , I'm not able to connect to the Database thru Jdev. EM console is not opening too.
Is there any way I can connect to Database while I'm not on the network ?
Your listener has to be configured to listen to your localhost internal interface, 127.0.0.1, for you to be able to connect when not on a network.
If it's only configured with your network adapter's IP address you will only be able to connect while on the network. When you unplug your LAN cable the interface associated with that IP is disabled and no longer reachable, even from within your PC. You will also have problems if your IP is allocated by DHCP, and would need to use a DNS name that follows reallocation; that's why servers usually have fixed IPs.
You can configure the listener to use both addresses if you need to be able to connect locally when off the network, but have other clients connect to your database when you are on the network. Having a DB that others need to access on a machine that isn't always connected would be a bit odd though.
I have created database and user and give all the privilege to the user.When i give the IP as Database host.It will show the following errors.Giving hostname as localhost it will work fine.
I am using phpmyadmin 3.3.2...
The error message is given below.
Failed to connect to your MySQL database server. MySQL reports the following message: Can't connect to MySQL server on '192.168.85.10' (111)
It seems that the IP address you use is your "external" IP and not the IP localhost would resolve to, which is most of the time your loopback: 127.0.0.1.
So if you are trying to connect from the same computer as the database is running you should use 127.0.0.1 as the IP address.
If you are trying to connect to your database from another computer on the network, you should enable MySQL remote access in your my.conf (MySQL config file). Because by default MySQL disables remote incoming connections.
You do this by setting the "bind-address" line to your real (external) server IP as such:
bind-address = 192.168.xx.xx (assuming its on your local network)
Or put the bind-address in comment.
Also make sure that the skip-networking option is commented as such:
#skip-networking
And then restart your MySQL server.
Now also make sure that your MySQL users are also allowed to connect from locations other then "#localhost".
I hope this helps!
Cheers,
Timusan