Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection to server at "localhost" (127.0.0.1), port 5432 failed: FATAL: password authentication failed for user "postgres" #1696

Closed
brunolnetto opened this issue May 13, 2024 · 6 comments

Comments

@brunolnetto
Copy link

Please complete the following information:

  • OS: Ubuntu 22.04
  • Psycopg version: 3.1.19
  • Python version: Python 3.10.12
  • PostgreSQL version: 13
  • pip version: 24.0

Describe the bug
Please let us know:

1: Please, take a look at the link below. In this application, I utilize library psycopg2 to connect to the database and perform queries.

https://github.com/brunolnetto/RF_CNPJ/blob/0bb33b6fed9781a643b13333f2047f9ce1dca94f/src/core/setup.py#L51

2: I expected to be able to at least instanciate a session and execute some operation.
3: I got an exception 'OperationalError'.

connection to server at "localhost" (127.0.0.1), port 5433 failed: FATAL: password authentication failed for user "postgres"

If possible, provide a script reproducing the issue. The source code is available on . To reproduce only the required script, run from folder src.

from core.setup import setup_database

setup_database()

It does not seem a problem on reproduction. I tested locally on my machine, and got the same issue. I guess, it is an role issue.

@dvarrazzo
Copy link
Member

Not a psycopg issue.

@brunolnetto
Copy link
Author

I even wrote an issue on Stack Overflow threads [1] about the topic, without response so far. Would you mnid taking a look, please?

[1] https://stackoverflow.com/questions/78477505/psycopg2-connection-to-server-at-localhost-1-port-5432-failed-cannot-as

@dvarrazzo
Copy link
Member

What you require is a professional consultancy about how to connect to a database.

Please get in touch privately to discuss my hourly rate.

@brunolnetto
Copy link
Author

I am a student, I cannot afford more than I can pay my rent. Sorry.

@dvarrazzo
Copy link
Member

Then you can find documentation online for what you are looking for.

@brunolnetto
Copy link
Author

I reproduce the content I find, like this [1], without much of success. I suppose, you are able to fix the code. Thanks for even answering.

[1] https://www.docker.com/blog/how-to-use-the-postgres-docker-official-image/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants