Postgres pgAdmin III Access to Database Denied - database

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.

Related

Connection to the database failed - server closed the connection unexpectedly. This probably means the server terminated abnormally

The rest of the error is "before or while processing the request."
I have a CentOS server running Postgres on an internal network scheme 192.168.11.0/24 for which I also have pgAdmin4 also installed and running. pgAdmin is connecting via localhost and I can successfully connect to my database.
I am running a windows 10 client on 192.168.11.100 with Lazarus trying to get a TPQConnection object to connect. This error comes up when I click the "Connected" property with all the connection information filled in.
The server is running on 192.168.11.25.
I have the Postgres client libraries extracted and in my system path (the bin directory) for the version of Postgres I'm running (12.5)
My pg_hba.conf file is set up to allow the connecton - Here are the relevant lines:
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 md5
host all all 192.168.11.0/24 md5
# IPv6 local connections:
host all all ::1/128 md5
I've set the password for the postgres user and verified that the account works with pgAdmin.
I'm not sure if this has to do with Lazarus or if this is a postgres client library problem.
I have also tried installing the Postgres ODBC client and attempted to create a DSN and was unsuccessful with that as well. I'm guessing this could be a configuration problem on the server not sure though.
Rich
I figured it out finally - been struggling with this for 2 days! By default Postgres only listens on localhost.
I had to edit postgresql.conf listen_addresses parameter and set it to '*' or equivalent IP address if I want to be more restrictive. With the pg_hba.conf restricting from which addresses login can happen on it seems perfectly sufficient to use '*' for listen_addresses.
After that I was able to connect from Lazarus.
Rich

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.

Connecting to SQL Server running on Parallels on Mac

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.

How to access Oracle 10g Server over a Local Area Network?

I installed Oracle 10g server Express edition on a System(say host-a[100.101.102.103])
And I tried access the database from another system(say host-b[100.101.102.104]) using the
command on the sql command line
"**connect username/password#100.101.102.103:1521/XE**"
But it says something like
request timeout.ORA-12170:TNS:Connect timeout occured
... where I made mistake....
All the username, password and ip all are correct.
Both Systems are in the same Local Area Connection....
Please someone help me.
You most likely have a firewall that prevents connecting to your database by silently dropping the network packets.
Is the database on a Windows server with the Windows Firewall activated? If yes, you need to create an exception for port 1521 (and potentially for 2030 and 8080 as well).

Databse Connection error By Giving Specific IP address-Drupal

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

Resources