2

I was working on our company's new API build for the last 6 months and when I was made aware of a problem with our existing system. I tried to access my local env again to try to debug and found my local DB locked down for an unknown reason with a password that was not root (the initial password I set). Now, I cannot log in at all to my local DB server and editing the pg_hba.conf file and restarting the server did nothing. It was still asking for a password. Any advice is greatly appreciated. specs and screenshot below:

Environment: Windows 10 Pro
Codebase Language: Elixir
DB: postgresql 10
Port: 5432
config :rog_api, RogApi.Repo,
  adapter: Ecto.Adapters.Postgres,
  username: "postgres",
  password: "root",
  database: "rog_api_local",
  hostname: "localhost",
  pool_size: 18

PgAdmin Interface Screen Shot.

pg_hba.conf file:

# TYPE  DATABASE        USER            ADDRESS                 METHOD
host    all             all             all                     trust
# IPv4 local connections:
#host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
#host    all             all             ::1/128                 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#host    replication     all             127.0.0.1/32            md5
#host    replication     all             ::1/128                 md5
Máté
  • 2,294
  • 3
  • 18
  • 25
Marc Tanne
  • 101
  • 1
  • 9
  • Look this: https://stackoverflow.com/questions/10845998/i-forgot-the-password-i-entered-during-postgres-installation – bdn02 Feb 14 '19 at 22:57
  • I already did. That effort is outlined above. – Marc Tanne Feb 14 '19 at 22:58
  • have you tried "you can now connect as any user. Connect as the superuser postgres (note, the superuser name may be different in your installation. In some systems it is called pgsql, for example.)"? Have you found an error? – bdn02 Feb 14 '19 at 23:01
  • it still asks for a password. I cannot get that response. – Marc Tanne Feb 14 '19 at 23:02
  • ok, i'm not a postesql expert, but i think that the trust authentication is a Windows feature. Try to open "Services.msc", try postersql and set identity to the same user that you use for Windows. Restart database service and retry with "psql -h 127.0.0.1 -U postgres" – bdn02 Feb 14 '19 at 23:22
  • Are you able to login using `psql` or any other DBMS tool? – Murtuza Z Feb 17 '19 at 13:25
  • @n33rma I am not able to do so – Marc Tanne Feb 18 '19 at 19:11
  • @bdn02 can you please elaborate on which Services.msc to access? I still cannot figure out how to access the DB with the postgres user. If I can figure out how to change the root user tied to the DB, that will solve my issue I think. – Marc Tanne Feb 19 '19 at 00:41
  • Start -> Run -> digit "services.msc", this open the "services" administrative console where you can start, stop and modify the services – bdn02 Feb 19 '19 at 08:39
  • @bdn02, in your comment above did you mean postgresql server 10 service? That is what I see in services.msc. In its properties, I found a `Log On` tab which has an account field that is populated with `Network Service` as the user, a `password`, and a `confirm password`. You are saying that I should set these to the login information I use to log into my computer on boot? – Marc Tanne Feb 20 '19 at 23:24

0 Answers0