Not able to connect pgAdmin4 with elephantsql - postgresql

I want to use elephantsql with pgadmin but not able to connect.
Below is the my issue:-"
FATAL: no pg_hba.conf entry for host "169.149.233.33", user "tfndkxmm", database "aaehpcif", SSL on
FATAL: no pg_hba.conf entry for host "169.149.233.33", user "tfndkxmm", database "aaehpcif", SSL off
i am following this instruction : https://www.elephantsql.com/docs/pgadmin.html but keep getting this error.
I had seen similar question on Stackoverflow.But it doesn't solve my problem.
I am also attaching my connection Screenshot here.
Please someone help me to resolve this issue.
Thanks

Related

Postgres Remote Access

My teammate can't access to my Database on PgAdmin. I have connected the database on IntelliJ.
That's what i see:
That's what my teammate see:
Under postgres>schemas>public
He can only see Student table.
On the file postgresql.conf I already have replaced the line listen_addresses = 'localhost' with listen_addresses= '*'
And on the file pg_hba.conf that's the situation:
Why he cant see all the tables? How can we fix it?
We need that from his pc he can access to my database.
Thanks for help and orry for bad english.

Is there a reason pg_shadow shows a password, yet log shows no password assigned?

I created a new postgresql 11 database cluster. I wrote a simple CRUD script using SQLAlchemy to test the connection on localhost and get "user authentication failed" output from python.
I checked the pg_hba.conf file for the new cluster and it shows:
local all ian peer
Already checked pg_authid and pg_shadow which clearly shows md5 password assigned to the db owner "ian." Also, I have checked that the new cluster is running with pg_lsclusters and it shows it running on port 5433. Checked logs after connection attempts and get the following message:
2018-11-16 10:00:59.712 PST [2102] ian#iandb1 DETAIL: User "ian" has no password assigned.
Connection matched pg_hba.conf line 94: "host all all ::1/128 md5"
A little background: I have already connected this script to the default DB cluster owned by postgres. I can connect and perform the CRUD operations fine with the postgres username and password in the connection string.
Any help would be appreciated. I think there is some type of change I need to make, but can't imagine where it needs to happen. Still learning the ropes.
Ok, well I hope this post saves someone else a little frustration, immediately after submitting this question-- which had me stumped for several hours, I found this:
source: link to article
By default, when you create a PostgreSQL cluster, password authentication for the database superuser (“postgres”) is disabled. The simplest and safest way to add a password to the “postgres” user is to connect to the local server using “psql” (see steps #1 and #2 above), then type the “\password” meta command of psql. You will be asked to enter a password and confirm it.
postgres=# \password
Enter new password:
Enter it again:
postgres=#
I substituted my new cluster owner name 'ian' and assigned a password. I ran the script and everything seems to be working fine now. These are the little things new programmers have to struggle through I guess... Thanks to anyone who can add to my explanation here.

FATAL: no pg_hba.conf entry for host” but I can connect trough pgAdmin

Update: It seems to be problem with ElephantSQL, the service I'm using according to this
However, I dont know where to add this.
Exact error:
FATAL: 28000: no pg_hba.conf entry for host "host", user "username", database "template1", SSL off
Similar error to this problem. Even after adding SslMode=require, I still couldn't connect to the database.
<add name="DefaultConnection" connectionString="Server=serverip;Port=5432;Database=dbname;User Id=username;Password=pass;CommandTimeout=60;Preload Reader=True;"/>
Weird thing is that it tried to connect to template1 instead of database specified in the connection string.
Connecting through pgadmin is fine though.
It's because you're on a shared ElphantSQL plan and can only connect to your own database. Npgsql tries to connect to template1 for some reason when it's checking server version, creating new databases etc, ignoring the database name given in the connection string. We'll submit a bug report to Npgsql.
I am 4 years late to this party but had this issue with npgsql also and this question came up so hopefully this helps someone else in the same boat next time.
I was able to fix it by adding "EF Template Database=[MyDatabase]" to my connection string. The default for that value is "template1" according to npgsql documentation

Sqlalchemy and pgpool-II - OperationalError

Today I set up pgpool-II on one of my company servers for database replication purposes and I'm trying to connect to it from my application located on another server. Previously it connected to database on the same server where pgpool is now installed without problems - I just needed to provide something like this link in config file:
database: postgresql://user:password#host:port/db_name
I have changed port to the one on which pgpool listens for connections and provided user and password from pcp.conf, but then I get a list of errors after starting app, all of them of the same type:
OperationalError: (OperationalError) unable to open database file None None
Doesn't matter if I'm authenticating as postgresql or pgpool user and if I provide md5 encrypted or plaintext password, errors are the same. How can I properly connect to my database then?
Problem solved days ago, needed to change administrative database in pgpool config from "template1" to "postgres". IDK why it doesn't default to that.

Error connecting to the Server in postgreSQL

I am trying to add a connection to the server in postgreSQL. But when I fill all the details I get this error
Error connecting to the server: FATAL: role "abc" does not exist.
"abc" is the username I want to create.
I am using Tomcat server eclipse for this.
Please help me find a solution to this problem.
Thanks in advance!
If the user does not yet exist, you will have to login as the admin and create it before you can login as that user.