pgAdmin 4. Unable to connect to server - postgresql

I had a postgreSQL server/database working in a local area network in Windows. To have access to it through Ethernet I changed the IP in the router settings. Everything was fine. But when I came today to the office, I could not have connected to the server. Moreover, I cannot even create a localhost server on that PC. The error is "Unable to connect to server:" and nothing else. When I turn off the postgres in services it specifies the error with TCP/IP, port, etc. But not when the service is on. When connecting to the server, the pgAdmin asks for the postgres password. Endlessly, thou the password is printed correctly and the METHOD is set to trust. The reinstallation did not help.
What does this error mean? And what is the cure?

Related

Cannot connect to MySQL Database in Workbench

It's my first time working with MySQL, so it's not much I know about it. I just installed MySQL Workbench client (no server) and attempted to connect to a MySQL database that exists on a different host.
I tried to connect to an external database and received an error. I used a Standard (TCP/IP) connection, entered an IP address for the other hosting machine, user name and password and clicked Test Connection. The error I am getting: "Failed to connect to MySQL at HostName with User. Unable to connect to localhost."
Why is it connecting to localhost if I entered a totally different IP? I don't have a localhost and I don't need it. Is there anything special that I have to do when I connect to a different server?

Unable to Connect to Postgres Server Remotely

I set up a Postgres server on my computer (windows) at home just to run some basic work when I am away from home, but I am unable to connect to it outside of my home network. I have setup my pg_hba.conf file to accept connections from my laptop and I have set listen_addresses to '*'. It works perfectly fine if my laptop is on the same network as my home computer, but if I go to any other network it fails to even recognize the connection.
Returns the following in pgAdmin4: could not connect to server: Connection timed out.
Any ideas?

SQL Developer doesn't connect using Hostname of my machine

I'm not able to connect to local oracle database from SQL Developer when I'm giving my computer hostname for "Hostname" field in SQL Developer connection.
Database and SQL Developer are running on the same machine.
SQL Developer was able to connect when hostname are replaced with following:
localhost --localhost as hostname is working
127.0.0.1 --This is working as well
192.168.0.5 --Static IP Configured for machine is working
10.10.10.10 --Loopback configured for machine is working
Attached files showing following info:
"Config files details" : hosts, tnsnames.ora, listener.ora, sqlnet.ora
"SQL Developer and Network adapter details" : Network adapters used, Screen shots showing the SQL Developer connection details
My Machine is a standalone home PC, So, it doesn't have any domain name associated with it.
It is configured both loopback and Static-IP and hosts file reflects them appropriately.
My Home Wifi-Router is configured to assign Static-IP to my machine based on MAC-Address.
Resolving this is required because, I have used my computer hostname instead of IP-Address as source connection for some other application (Same machine), which i don't want to modify, as the static IP-Adress might need to be modified later and that would require to go to the other application again and again.
I've tried to delete and create the listener afresh, that didn't work !! Not sure, what's wrong with this Hostname.
Thanks,
Durga.
SQL Developer and Network adapter details
Config files details
Edit: Also, weirdly enough, SQLPlus connects to the host when i give the password directly in connection string. However, it says TNS doesn't know of the service when i don't give password as part of connection string. (Attached the screen shot)
Screenshot showing the behaviour of SQLPlus With/Without password in connection string

Problems connecting to Postgresql server?

I am running a Postgresql server hosted on heroku as part of an app I am developing. I've been using PGAdmin as a frontend to set up my tables and also check to make sure the app is correctly writing data to the tables. When I am at home it connects fine and I can use it with no problems. It also works when I tether to my phone's WiFi hotspot. However when I am in university on the WiFi it does not connect. I get the following error:
"could not connect to server: Connection timed out (0x0000274C/10060) Is the server
running on host <MY HOSTNAME> and accepting TCP/IP connections on port 5432?"
I'm trying to troubleshoot this. I tried the obvious things like checking my hostname and port are correct (they are, because it works from home!) and checking that Pgadmin has permissions in windows firewall (it does). Not sure what to try next.
Is it likely to be that the port is blocked? I used an online port checker which reported that the port (5432) was closed, however it also says this when using my phone's wifi hotspot (which normally works, as I said). Is there another port I can use with Postgresql?
OK, it turns out the port 5432 was actually closed on my university's WiFi. I was able to request that it be opened, and everything is now working.

PGAdmin III cannot connect AWS RDS

I am trying to connect AWS RDS PostgreSql from PgAdmin 3. I followed the below link
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ConnectToPostgreSQLInstance.html
In Security Group, I also added PostgreSQL and All traffic as below
The "publicly accessible" flag was enabled (updated after Mark B's comment)
I got the error from PGAdmin3
Very appreciate for any suggestion
******UPDATE*******
I can connect pgAdminIII to AWS RDS successfully using home wifi, but cannot connect using office wifi.
My concern is:
Was the port 5432 blocked by office wifi?
How can I configure/update the port without impacting to current API?
Note: My current API is working well (CRUD)
Can you can test your connection to a DB instance using common Linux or Windows tools first?
From a Linux or Unix terminal, you can test the connection by typing the following (replace with the endpoint and with the port of your DB instance):
$nc -zv DB-instance-endpoint port
For example, the following shows a sample command and the return value:
$nc -zv postgresql1.c6c8mn7tsdgv0.us-west-2.rds.amazonaws.com 8299
Connection to postgresql1.c6c8mn7tsdgv0.us-west-2.rds.amazonaws.com
8299 port [tcp/vvr-data] succeeded!
Windows users can use Telnet to test the connection to a DB instance. Note that Telnet actions are not supported other than for testing the connection. If a connection is successful, the action returns no message. If a connection is not successful, you receive an error message such as the following:
C:>telnet sg-postgresql1.c6c8mntzhgv0.us-west-2.rds.amazonaws.com
8299
Connecting To sg-postgresql1.c6c8mntzhgv0.us-west-2.rds.amazonaws.com...Could not
open connection to the host, on port 819: Connect failed
If Telnet actions return success, then you are good to go.
If you are trying to access it from a network which is not listed for that port. you need to add inbound rules for those network IPs from AMAZON RDS system
You will also need to set Public accessibility true under Connect & security tab in RDS console.
Read this post.In your security group go to unbound rules and add my ip.
and make sure your database is public.
https://serverfault.com/questions/656079/unable-to-connect-to-public-postgresql-rds-instance