Answer the question
In order to leave comments, you need to log in
Why is postgreSQL not working?
Previously I used sqlite in my "mini project", but as it turned out, heroku only accepts postgreSQL.
Installed postgres, psycopg2 module. I run, I get 0 reactions. There are no errors, there is nothing .. But as I understand it, nothing happens. What am I doing wrong?
import psycopg2
connection = psycopg2.connect(
host="localhost",
port = 50307,
database="bot",
user="postgres",
password="vollchara.mp4"
)
cursor = connection.cursor()
print("Database opened successfully")
Answer the question
In order to leave comments, you need to log in
Did you install postgree?
The normal port for postgres is 5432. When you specify localhost to pgadmin and that port is the connection made? For the postgres user with the password specified during installation, authorization passes?
Get a successful connection with psql or pgadmin, then get to grips with python. It will be really faster, in the sense of understanding what exactly did not work.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question