Y
Y
YogurtJoe2016-05-12 12:13:26
Python
YogurtJoe, 2016-05-12 12:13:26

Python: Connecting to Postgres DB via SSH?

Hello.
Interested in connecting to the Postgres database using Python.
First you need to create an ssh tunnel.
If there is a live example - generally great.
I myself am trying to solve the problem this way: I use the sshtunnel + psycopg2 libraries.
I also tried other libraries for working with Postgres and Python - for example, PygreSql, pg8000 and spur.
Using ssh (from the command line), the tunnel is built, I connect to the database. I also easily connect to the database through software (Beaver).
As a result, I still ran into an error:
password authentication failed for user "vanja-ivanov"
PS I do everything described under Linux (Ubuntu). If there is a solution for Windows, I will also not refuse.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question