How do I connect to the Divio postgres database with local PgAdmin? - postgresql

I am trying to connect with PgAdmin to the local Divio database in the container but PgAdmin 4 will not let me connect without a password. The Divio Postgres database seems to come without a password.
Has anyone got round this?

You don't need a password.
See Interact with the local database from your host environment in the official documentation.
The key things are:
expose the database’s port by editing the docker-compose.yml file
use the correct credentials
Both steps are described in more detail in the documentation. I haven't given more specific details here such as port numbers in case those details ever change in the future.

Related

Trouble connecting to PostgreSQL container through pgAdmin

I am currently working on a school project and I need to connect to a PostgreSQL container through pgAdmin. I have used docker-compose to create the container instance of PostgreSQL and PostGIS.
But when I try to connect to my PostgreSQL container, it does not work. Maybe I have entered the details wrongly? I have attached a screenshot here of the docker-compose.yml file and the parameters that I have filled in on my pgAdmin Desktop.
What am I doing wrong?
netstat-output
Can anyone please help me? Would really appreciate it !!
Your db container's outside port is 54320, not 5432. You are trying to connect postgis container instead of postgres. And your passwords are different from each other.
You can do one of the below;
If you still want to connect to postgis, you can use password accordingly.
If you want to connect to postgres, change port to 54320 in pgAdmin.

Troubleshoot connecting to free trial postgres on AWS RDS

This is a temporary database, so I don't mind sharing credentials. We have setup the following in RDS:
Host and Port and confirming public access
DB Name
Not shown is the username and password, however I am 100% certain that we are inputting the correct username and password into PgAdmin 4 and into python's psycopg2.connect function.
Failing connection in PgAdmin 4
However, we are failing to connect in both PgAdmin 4 and in python. The database is definitely public, and I am fairly certain that we are inputting the correct parameters. I believe dbname is testdb and not the instance ID etl-test
What could be the issue? The one thing I am not certain about are the VPCs and the VPC security groups... do we need to input these anywhere into python or PgAdmin4 in order to connect?
Its not the issue with pg-Admin or python. Looks like you don't have proper inbound rules set up.
this blog post might interests you

How to connect to database through JDBC in pgAdmin?

I have database connection settings and pgAdmin (it is all that i have). Can I connect to the database through the pgAdmin to make the necessary changes in the database using these settings? If so, how?
I have not found how I can do this. Other answers here (and in google too) suggest writing Java-code - this is not what i need. I want to use pgAdmin interface for it. Can I make changes without using Java-code?
Here example of settings that i have:
jdbc.driverClassName - org.postgresql.Driver
jdbc.url - jdbc:postgresql://localhost:4444/
jdbc.username - username
jdbc.password - password
I don't understand why people don't understand what he's trying to do. He just wants to connect to db using pgAdmin. He just doesn't understand how to use the connection string in pgAdmin.
Basically, just remove all prefixes and suffixes (eg. jdbc:postgresql://). So your hostname is localhost. Type localhost in host name, 4444 in port name as well as your username and password. Also give it a name in General tab Then you'll see the databases on the left. Click Tools > Query Tool and write your select/insert etc. scripts.

Connecting locally to a HerokuConnect Postgres database

I'm building a simple web app that will deploy on Heroku, and using a Postgres database that is filled with an object from Salesforce. I did that with HerokuConnect and that works.
Now I want to see the contents of the database so that I know the table names, and I already know you can't do that on Heroku itself. So, I tried to connect to the database locally via heroku pg:psql but everytime I do that I get the error:
---> Connecting to DATABASE_URL
DL is deprecated, please use Fiddle
psql: could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "***.***.***.**" (**.***.***.***) and accepting
TCP/IP connections on port ****?
So that doesn't work. I tried the following but to no avail:
explicitly specifiying the name of the database
specifying host, user, database name, password, port and setting sslmode=require per the user guide and this question about connecting to a heroku postgresql database.
using the method above, but instead of using heroku psql I just used psql. That asked for a password but for a user I never created (a user with my corporate system name, because this is a corporate laptop)
reinstalling Postgres
Running heroku pg:info correctly lists my database information.
I am missing something, but I don't know what it is.
"DL is deprecated, please use Fiddle" is not an error but it's only a warning.
This is due to an issue with Ruby 2 on Windows.

PostgreSQL: One database to multiple user

I have PostgreSQL 9.3 version. I have created database name db1 now I need it to share with other users who all are connected with the LAN's to connect other applications with the same database.
In SQL Server: We can do this by selecting server name with login details.
Question:
Is it possible in PostgreSQL?
If yes, how can do this?
What is the procedure?
You will need to modify pg_hba.conf to allow remote connections to the database. Information about pg_hba.conf can be found here.
After that, you can connect programatically with a connection string, or similar to your image, with a GUI application like pgAdmin.
To connect (remotely or locally) from pgAdmin choose File -> Add Server... and enter the connection information into the dialog box. Here's an example of the window:
Your client computers will also need to have PostgreSQL drivers as well. If you're doing this in Windows, you'll probably be using ODBC. The PostgreSQL ODBC drivers are here. Info on the connection string format can be found here.
Here's an example of what pgAdmin looks like: